Average Error: 1.8 → 0.3
Time: 4.9s
Precision: binary64
\[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\]
\[x - \frac{\frac{y - z}{\left(t - z\right) + 1}}{\frac{1}{a}}\]
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
x - \frac{\frac{y - z}{\left(t - z\right) + 1}}{\frac{1}{a}}
(FPCore (x y z t a)
 :precision binary64
 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
(FPCore (x y z t a)
 :precision binary64
 (- x (/ (/ (- y z) (+ (- t z) 1.0)) (/ 1.0 a))))
double code(double x, double y, double z, double t, double a) {
	return x - ((y - z) / (((t - z) + 1.0) / a));
}
double code(double x, double y, double z, double t, double a) {
	return x - (((y - z) / ((t - z) + 1.0)) / (1.0 / a));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.8
Target0.3
Herbie0.3
\[x - \frac{y - z}{\left(t - z\right) + 1} \cdot a\]

Derivation

  1. Initial program 1.8

    \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\]
  2. Using strategy rm
  3. Applied div-inv_binary641.9

    \[\leadsto x - \frac{y - z}{\color{blue}{\left(\left(t - z\right) + 1\right) \cdot \frac{1}{a}}}\]
  4. Applied associate-/r*_binary640.3

    \[\leadsto x - \color{blue}{\frac{\frac{y - z}{\left(t - z\right) + 1}}{\frac{1}{a}}}\]
  5. Final simplification0.3

    \[\leadsto x - \frac{\frac{y - z}{\left(t - z\right) + 1}}{\frac{1}{a}}\]

Reproduce

herbie shell --seed 2020224 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (- x (* (/ (- y z) (+ (- t z) 1.0)) a))

  (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))