Average Error: 11.3 → 1.0
Time: 3.8s
Precision: binary64
Cost: 832
\[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
\[x - \frac{y}{z - \frac{y}{\frac{2}{\frac{t}{z}}}}\]
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
x - \frac{y}{z - \frac{y}{\frac{2}{\frac{t}{z}}}}
(FPCore (x y z t)
 :precision binary64
 (- x (/ (* (* y 2.0) z) (- (* (* z 2.0) z) (* y t)))))
(FPCore (x y z t) :precision binary64 (- x (/ y (- z (/ y (/ 2.0 (/ t z)))))))
double code(double x, double y, double z, double t) {
	return x - (((y * 2.0) * z) / (((z * 2.0) * z) - (y * t)));
}
double code(double x, double y, double z, double t) {
	return x - (y / (z - (y / (2.0 / (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.3
Target0.1
Herbie1.0
\[x - \frac{1}{\frac{z}{y} - \frac{\frac{t}{2}}{z}}\]

Alternatives

Alternative 1
Error2.2
Cost1160
\[\begin{array}{l} \mathbf{if}\;z \leq -1.8270469146563132 \cdot 10^{-168} \lor \neg \left(z \leq 2.047172950454266 \cdot 10^{-122}\right):\\ \;\;\;\;x - \frac{y}{z - \frac{y \cdot t}{z \cdot 2}}\\ \mathbf{else}:\\ \;\;\;\;x - -2 \cdot \frac{z}{t}\\ \end{array}\]
Alternative 2
Error7.2
Cost776
\[\begin{array}{l} \mathbf{if}\;z \leq -1.2243386802970412 \cdot 10^{-38} \lor \neg \left(z \leq 4.1882065358717915 \cdot 10^{-66}\right):\\ \;\;\;\;x - \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x - -2 \cdot \frac{z}{t}\\ \end{array}\]
Alternative 3
Error23.5
Cost320
\[x - \frac{y}{z}\]
Alternative 4
Error60.7
Cost385
\[\begin{array}{l} \mathbf{if}\;x \leq -2.819743941771419 \cdot 10^{-256}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 5
Error61.7
Cost64
\[1\]

Error

Derivation

  1. Initial program 11.3

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

    \[\leadsto \color{blue}{x - \frac{y}{z - \frac{y \cdot t}{2 \cdot z}}}\]
  3. Using strategy rm
  4. Applied associate-/l*_binary64_85481.0

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

    \[\leadsto x - \frac{y}{z - \frac{y}{\color{blue}{\frac{2}{\frac{t}{z}}}}}\]
  6. Simplified1.0

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

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

Reproduce

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

  :herbie-target
  (- x (/ 1.0 (- (/ z y) (/ (/ t 2.0) z))))

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