Average Error: 2.2 → 0.2
Time: 6.1s
Precision: binary64
\[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
\[x - a \cdot \frac{y - z}{\left(1 + t\right) - z} \]
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
x - a \cdot \frac{y - z}{\left(1 + t\right) - z}
(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 (/ (- y z) (- (+ 1.0 t) z)))))
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 - (a * ((y - z) / ((1.0 + t) - z)));
}

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.2
Target0.2
Herbie0.2
\[x - \frac{y - z}{\left(t - z\right) + 1} \cdot a \]

Derivation

  1. Initial program 2.2

    \[x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}} \]
  2. Taylor expanded in y around 0 10.2

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

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

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

Reproduce

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