Average Error: 9.5 → 2.0
Time: 4.9s
Precision: binary64
\[\frac{x \cdot \left(y - z\right)}{t - z} \]
\[x \cdot \frac{y - z}{t - z} \]
\frac{x \cdot \left(y - z\right)}{t - z}
x \cdot \frac{y - z}{t - z}
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
(FPCore (x y z t) :precision binary64 (* x (/ (- y z) (- t z))))
double code(double x, double y, double z, double t) {
	return (x * (y - z)) / (t - z);
}
double code(double x, double y, double z, double t) {
	return x * ((y - z) / (t - 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

Original9.5
Target1.9
Herbie2.0
\[\frac{x}{\frac{t - z}{y - z}} \]

Derivation

  1. Initial program 9.5

    \[\frac{x \cdot \left(y - z\right)}{t - z} \]
  2. Applied *-un-lft-identity_binary649.5

    \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{1 \cdot \left(t - z\right)}} \]
  3. Applied times-frac_binary642.0

    \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y - z}{t - z}} \]
  4. Simplified2.0

    \[\leadsto \color{blue}{x} \cdot \frac{y - z}{t - z} \]
  5. Final simplification2.0

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

Reproduce

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