Average Error: 11.4 → 2.3
Time: 3.1s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{t - z}\]
\[x \cdot \left(\left(y - z\right) \cdot \frac{1}{t - z}\right)\]
\frac{x \cdot \left(y - z\right)}{t - z}
x \cdot \left(\left(y - z\right) \cdot \frac{1}{t - z}\right)
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) (y - z)) * ((double) (1.0 / ((double) (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

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

Derivation

  1. Initial program 11.4

    \[\frac{x \cdot \left(y - z\right)}{t - z}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity11.4

    \[\leadsto \frac{x \cdot \left(y - z\right)}{\color{blue}{1 \cdot \left(t - z\right)}}\]
  4. Applied times-frac2.2

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

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

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

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

Reproduce

herbie shell --seed 2020114 +o rules:numerics
(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)))