x1 + \left(\left(\left(\left(\left(\left(\left(2 \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) \cdot \left(\frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + \left(x1 \cdot x1\right) \cdot \left(4 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 6\right)\right) \cdot \left(x1 \cdot x1 + 1\right) + \left(\left(3 \cdot x1\right) \cdot x1\right) \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right) + \left(x1 \cdot x1\right) \cdot x1\right) + x1\right) + 3 \cdot \frac{\left(\left(3 \cdot x1\right) \cdot x1 - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)x1 + \left(3 \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) - 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} + x1 \cdot \left(x1 \cdot \frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1}\right)\right) + \left(x1 \cdot x1 + 1\right) \cdot \left(x1 + \left(\left(x1 \cdot \left(\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1\right)\right) \cdot \frac{2 \cdot \left(\frac{\left(x1 \cdot \left(x1 \cdot 3\right) + 2 \cdot x2\right) - x1}{x1 \cdot x1 + 1} - 3\right) + x1 \cdot 4}{x1 \cdot x1 + 1} + \left(x1 \cdot x1\right) \cdot -6\right)\right)\right)(FPCore (x1 x2)
:precision binary64
(+
x1
(+
(+
(+
(+
(*
(+
(*
(*
(* 2.0 x1)
(/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
(- (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)) 3.0))
(*
(* x1 x1)
(-
(* 4.0 (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))
6.0)))
(+ (* x1 x1) 1.0))
(*
(* (* 3.0 x1) x1)
(/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))))
(* (* x1 x1) x1))
x1)
(* 3.0 (/ (- (- (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))))))(FPCore (x1 x2)
:precision binary64
(+
x1
(+
(*
3.0
(+
(/ (- (- (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))
(*
x1
(* x1 (/ (- (+ (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))))))
(*
(+ (* x1 x1) 1.0)
(+
x1
(+
(*
(* x1 (- (+ (* x1 (* x1 3.0)) (* 2.0 x2)) x1))
(/
(+
(*
2.0
(-
(/ (- (+ (* x1 (* x1 3.0)) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))
3.0))
(* x1 4.0))
(+ (* x1 x1) 1.0)))
(* (* x1 x1) -6.0)))))))double code(double x1, double x2) {
return x1 + (((((((((2.0 * x1) * (((((3.0 * x1) * x1) + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) * ((((((3.0 * x1) * x1) + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)) - 3.0)) + ((x1 * x1) * ((4.0 * (((((3.0 * x1) * x1) + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))) - 6.0))) * ((x1 * x1) + 1.0)) + (((3.0 * x1) * x1) * (((((3.0 * x1) * x1) + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)))) + ((x1 * x1) * x1)) + x1) + (3.0 * (((((3.0 * x1) * x1) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0))));
}
double code(double x1, double x2) {
return x1 + ((3.0 * (((((x1 * (x1 * 3.0)) - (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)) + (x1 * (x1 * ((((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)))))) + (((x1 * x1) + 1.0) * (x1 + (((x1 * (((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1)) * (((2.0 * (((((x1 * (x1 * 3.0)) + (2.0 * x2)) - x1) / ((x1 * x1) + 1.0)) - 3.0)) + (x1 * 4.0)) / ((x1 * x1) + 1.0))) + ((x1 * x1) * -6.0)))));
}



Bits error versus x1



Bits error versus x2
Results
Initial program 0.5
Simplified0.5
rmApplied div-inv_binary640.5
Applied associate-*l*_binary640.5
Simplified0.5
rmApplied *-un-lft-identity_binary640.5
Applied times-frac_binary640.5
Applied associate-*r*_binary640.6
Simplified0.6
Final simplification0.6
herbie shell --seed 2020232
(FPCore (x1 x2)
:name "Rosa's FloatVsDoubleBenchmark"
:precision binary64
(+ x1 (+ (+ (+ (+ (* (+ (* (* (* 2.0 x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) (- (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)) 3.0)) (* (* x1 x1) (- (* 4.0 (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))) 6.0))) (+ (* x1 x1) 1.0)) (* (* (* 3.0 x1) x1) (/ (- (+ (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0)))) (* (* x1 x1) x1)) x1) (* 3.0 (/ (- (- (* (* 3.0 x1) x1) (* 2.0 x2)) x1) (+ (* x1 x1) 1.0))))))