Average Error: 11.7 → 2.5
Time: 2.7s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\frac{x}{\left(t - z\right) \cdot \frac{1}{y - z}}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\frac{x}{\left(t - z\right) \cdot \frac{1}{y - z}}
double code(double x, double y, double z, double t) {
	return ((double) (((double) (x * ((double) (y - z)))) / ((double) (t - z))));
}
double code(double x, double y, double z, double t) {
	return ((double) (x / ((double) (((double) (t - z)) * ((double) (1.0 / ((double) (y - z))))))));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original11.7
Target2.4
Herbie2.5
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Initial program 11.7

    \[\frac{x \cdot \left(y - z\right)}{t - z}\]
  2. Using strategy rm
  3. Applied associate-/l*2.4

    \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
  4. Using strategy rm
  5. Applied div-inv2.5

    \[\leadsto \frac{x}{\color{blue}{\left(t - z\right) \cdot \frac{1}{y - z}}}\]
  6. Final simplification2.5

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

Reproduce

herbie shell --seed 2020162 
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (/ x (/ (- t z) (- y z)))

  (/ (* x (- y z)) (- t z)))