Average Error: 11.8 → 1.0
Time: 2.4m
Precision: 64
\[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
\[x - \frac{y}{\frac{z \cdot 2}{2} - \frac{y \cdot 1}{\frac{2 \cdot z}{t}}}\]
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
x - \frac{y}{\frac{z \cdot 2}{2} - \frac{y \cdot 1}{\frac{2 \cdot z}{t}}}
double code(double x, double y, double z, double t) {
	return ((double) (x - ((double) (((double) (((double) (y * 2.0)) * z)) / ((double) (((double) (((double) (z * 2.0)) * z)) - ((double) (y * t))))))));
}
double code(double x, double y, double z, double t) {
	return ((double) (x - ((double) (y / ((double) (((double) (((double) (z * 2.0)) / 2.0)) - ((double) (((double) (y * 1.0)) / ((double) (((double) (2.0 * z)) / t))))))))));
}

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.8
Target0.1
Herbie1.0
\[x - \frac{1}{\frac{z}{y} - \frac{\frac{t}{2}}{z}}\]

Derivation

  1. Initial program 11.8

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

    \[\leadsto x - \frac{\color{blue}{y \cdot \left(2 \cdot z\right)}}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
  4. Applied associate-/l*6.6

    \[\leadsto x - \color{blue}{\frac{y}{\frac{\left(z \cdot 2\right) \cdot z - y \cdot t}{2 \cdot z}}}\]
  5. Using strategy rm
  6. Applied div-sub6.6

    \[\leadsto x - \frac{y}{\color{blue}{\frac{\left(z \cdot 2\right) \cdot z}{2 \cdot z} - \frac{y \cdot t}{2 \cdot z}}}\]
  7. Simplified2.9

    \[\leadsto x - \frac{y}{\color{blue}{\frac{z \cdot 2}{2}} - \frac{y \cdot t}{2 \cdot z}}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity2.9

    \[\leadsto x - \frac{y}{\frac{z \cdot 2}{2} - \frac{y \cdot \color{blue}{\left(1 \cdot t\right)}}{2 \cdot z}}\]
  10. Applied associate-*r*2.9

    \[\leadsto x - \frac{y}{\frac{z \cdot 2}{2} - \frac{\color{blue}{\left(y \cdot 1\right) \cdot t}}{2 \cdot z}}\]
  11. Applied associate-/l*1.0

    \[\leadsto x - \frac{y}{\frac{z \cdot 2}{2} - \color{blue}{\frac{y \cdot 1}{\frac{2 \cdot z}{t}}}}\]
  12. Final simplification1.0

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

Reproduce

herbie shell --seed 2020114 +o rules:numerics
(FPCore (x y z t)
  :name "Numeric.AD.Rank1.Halley:findZero from ad-4.2.4"
  :precision binary64

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

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