// This file is part of the SV-Benchmarks collection of verification tasks: // https://gitlab.com/sosy-lab/benchmarking/sv-benchmarks // // SPDX-FileCopyrightText: 2001-2016 Daniel Kroening, Computer Science Department, University of Oxford // SPDX-FileCopyrightText: 2001-2016 Edmund Clarke, Computer Science Department, Carnegie Mellon University // SPDX-FileCopyrightText: 2014-2021 The SV-Benchmarks Community // // SPDX-License-Identifier: LicenseRef-BSD-4-Clause-Attribution-Kroening-Clarke extern void abort(void); #include void reach_error() { assert(0); } extern void abort(void); void assume_abort_if_not(int cond) { if(!cond) {abort();} } extern float __VERIFIER_nondet_float(void); #define HALFPI 1.57079632679f #define NR 3 #if NR == 1 #define VAL 0.99 #elif NR == 2 #define VAL 1.0f #elif NR == 3 #define VAL 1.001f #elif NR == 4 #define VAL 1.01f #elif NR == 5 #define VAL 1.1f #elif NR == 6 #define VAL 1.2f #elif NR == 7 #define VAL 1.5f #elif NR == 8 #define VAL 2.0f #endif int main() { float IN = __VERIFIER_nondet_float(); assume_abort_if_not(IN > -HALFPI && IN < HALFPI); float x = IN; float result = x - (x*x*x)/6.0f + (x*x*x*x*x)/120.0f + (x*x*x*x*x*x*x)/5040.0f; if(!(result <= VAL && result >= -VAL)) {reach_error();} return 0; }