Average Error: 0.0 → 0.0
Time: 7.2s
Precision: binary64
\[\frac{x - y}{z - y}\]
\[\frac{x}{z - y} - \frac{y}{z - y}\]
\frac{x - y}{z - y}
\frac{x}{z - y} - \frac{y}{z - y}
(FPCore (x y z) :precision binary64 (/ (- x y) (- z y)))
(FPCore (x y z) :precision binary64 (- (/ x (- z y)) (/ y (- z y))))
double code(double x, double y, double z) {
	return (x - y) / (z - y);
}
double code(double x, double y, double z) {
	return (x / (z - y)) - (y / (z - y));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[\frac{x}{z - y} - \frac{y}{z - y}\]

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{z - y}\]
  2. Using strategy rm
  3. Applied add-cbrt-cube_binary64_1375420.3

    \[\leadsto \color{blue}{\sqrt[3]{\left(\frac{x - y}{z - y} \cdot \frac{x - y}{z - y}\right) \cdot \frac{x - y}{z - y}}}\]
  4. Simplified20.3

    \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{x - y}{z - y}\right)}^{3}}}\]
  5. Using strategy rm
  6. Applied div-inv_binary64_1371520.3

    \[\leadsto \sqrt[3]{{\color{blue}{\left(\left(x - y\right) \cdot \frac{1}{z - y}\right)}}^{3}}\]
  7. Applied unpow-prod-down_binary64_1379749.6

    \[\leadsto \sqrt[3]{\color{blue}{{\left(x - y\right)}^{3} \cdot {\left(\frac{1}{z - y}\right)}^{3}}}\]
  8. Applied cbrt-prod_binary64_1374948.0

    \[\leadsto \color{blue}{\sqrt[3]{{\left(x - y\right)}^{3}} \cdot \sqrt[3]{{\left(\frac{1}{z - y}\right)}^{3}}}\]
  9. Simplified38.0

    \[\leadsto \color{blue}{\left(x - y\right)} \cdot \sqrt[3]{{\left(\frac{1}{z - y}\right)}^{3}}\]
  10. Simplified0.2

    \[\leadsto \left(x - y\right) \cdot \color{blue}{\frac{1}{z - y}}\]
  11. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{\frac{x}{z - y} - \frac{y}{z - y}}\]
  12. Final simplification0.0

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

Reproduce

herbie shell --seed 2021098 
(FPCore (x y z)
  :name "Graphics.Rasterific.Shading:$sgradientColorAt from Rasterific-0.6.1"
  :precision binary64

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

  (/ (- x y) (- z y)))