Average Error: 2.0 → 0.3
Time: 4.7s
Precision: binary64
\[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}\]
\[x + \frac{a}{\frac{t + \left(1 - z\right)}{z - y}}\]
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
x + \frac{a}{\frac{t + \left(1 - z\right)}{z - y}}
(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 (/ a (/ (+ t (- 1.0 z)) (- z y)))))
double code(double x, double y, double z, double t, double a) {
	return ((double) (x - (((double) (y - z)) / (((double) (((double) (t - z)) + 1.0)) / a))));
}
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + (a / (((double) (t + ((double) (1.0 - z)))) / ((double) (z - y))))));
}

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

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

Derivation

  1. Initial program 2.0

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

    \[\leadsto \color{blue}{x + a \cdot \frac{z - y}{t + \left(1 - z\right)}}\]
  3. Using strategy rm
  4. Applied clear-num0.3

    \[\leadsto x + a \cdot \color{blue}{\frac{1}{\frac{t + \left(1 - z\right)}{z - y}}}\]
  5. Using strategy rm
  6. Applied un-div-inv0.3

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

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

Reproduce

herbie shell --seed 2020198 
(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))))