Average Error: 11.6 → 2.3
Time: 3.6s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[\frac{x}{\frac{t - z}{y - z}}\]
\frac{x \cdot \left(y - z\right)}{t - z}
\frac{x}{\frac{t - z}{y - z}}
double code(double x, double y, double z, double t) {
	return (((double) (x * ((double) (y - z)))) / ((double) (t - z)));
}
double code(double x, double y, double z, double t) {
	return (x / (((double) (t - z)) / ((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.6
Target2.3
Herbie2.3
\[\frac{x}{\frac{t - z}{y - z}}\]

Derivation

  1. Initial program 11.6

    \[\frac{x \cdot \left(y - z\right)}{t - z}\]
  2. Simplified2.4

    \[\leadsto \color{blue}{x \cdot \frac{y - z}{t - z}}\]
  3. Using strategy rm
  4. Applied clear-num2.6

    \[\leadsto x \cdot \color{blue}{\frac{1}{\frac{t - z}{y - z}}}\]
  5. Using strategy rm
  6. Applied un-div-inv2.3

    \[\leadsto \color{blue}{\frac{x}{\frac{t - z}{y - z}}}\]
  7. Final simplification2.3

    \[\leadsto \frac{x}{\frac{t - z}{y - z}}\]

Reproduce

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