Average Error: 6.9 → 2.5
Time: 6.6s
Precision: binary64
\[\frac{x \cdot 2}{y \cdot z - t \cdot z}\]
\[\left(\left(x \cdot \frac{{2}^{0.6666666666666666}}{\sqrt[3]{z}}\right) \cdot \frac{\frac{1}{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}}{\sqrt[3]{z}}\right) \cdot \frac{\frac{\sqrt[3]{2}}{\sqrt[3]{y - t}}}{\sqrt[3]{z}}\]
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\left(\left(x \cdot \frac{{2}^{0.6666666666666666}}{\sqrt[3]{z}}\right) \cdot \frac{\frac{1}{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}}{\sqrt[3]{z}}\right) \cdot \frac{\frac{\sqrt[3]{2}}{\sqrt[3]{y - t}}}{\sqrt[3]{z}}
(FPCore (x y z t) :precision binary64 (/ (* x 2.0) (- (* y z) (* t z))))
(FPCore (x y z t)
 :precision binary64
 (*
  (*
   (* x (/ (pow 2.0 0.6666666666666666) (cbrt z)))
   (/ (/ 1.0 (* (cbrt (- y t)) (cbrt (- y t)))) (cbrt z)))
  (/ (/ (cbrt 2.0) (cbrt (- y t))) (cbrt z))))
double code(double x, double y, double z, double t) {
	return (x * 2.0) / ((y * z) - (t * z));
}
double code(double x, double y, double z, double t) {
	return ((x * (pow(2.0, 0.6666666666666666) / cbrt(z))) * ((1.0 / (cbrt(y - t) * cbrt(y - t))) / cbrt(z))) * ((cbrt(2.0) / cbrt(y - t)) / cbrt(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

Original6.9
Target1.9
Herbie2.5
\[\begin{array}{l} \mathbf{if}\;\frac{x \cdot 2}{y \cdot z - t \cdot z} < -2.559141628295061 \cdot 10^{-13}:\\ \;\;\;\;\frac{x}{\left(y - t\right) \cdot z} \cdot 2\\ \mathbf{elif}\;\frac{x \cdot 2}{y \cdot z - t \cdot z} < 1.0450278273301259 \cdot 10^{-269}:\\ \;\;\;\;\frac{\frac{x}{z} \cdot 2}{y - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(y - t\right) \cdot z} \cdot 2\\ \end{array}\]

Derivation

  1. Initial program 6.9

    \[\frac{x \cdot 2}{y \cdot z - t \cdot z}\]
  2. Simplified5.5

    \[\leadsto \color{blue}{x \cdot \frac{\frac{2}{y - t}}{z}}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt_binary64_166266.1

    \[\leadsto x \cdot \frac{\frac{2}{y - t}}{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}\]
  5. Applied add-cube-cbrt_binary64_166266.3

    \[\leadsto x \cdot \frac{\frac{2}{\color{blue}{\left(\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}\right) \cdot \sqrt[3]{y - t}}}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}\]
  6. Applied add-cube-cbrt_binary64_166266.5

    \[\leadsto x \cdot \frac{\frac{\color{blue}{\left(\sqrt[3]{2} \cdot \sqrt[3]{2}\right) \cdot \sqrt[3]{2}}}{\left(\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}\right) \cdot \sqrt[3]{y - t}}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}\]
  7. Applied times-frac_binary64_165976.6

    \[\leadsto x \cdot \frac{\color{blue}{\frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}} \cdot \frac{\sqrt[3]{2}}{\sqrt[3]{y - t}}}}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}\]
  8. Applied times-frac_binary64_165976.6

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

    \[\leadsto \color{blue}{\left(x \cdot \frac{\frac{\sqrt[3]{2} \cdot \sqrt[3]{2}}{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\frac{\sqrt[3]{2}}{\sqrt[3]{y - t}}}{\sqrt[3]{z}}}\]
  10. Using strategy rm
  11. Applied pow1/3_binary64_166731.9

    \[\leadsto \left(x \cdot \frac{\frac{\sqrt[3]{2} \cdot \color{blue}{{2}^{0.3333333333333333}}}{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\frac{\sqrt[3]{2}}{\sqrt[3]{y - t}}}{\sqrt[3]{z}}\]
  12. Using strategy rm
  13. Applied div-inv_binary64_165881.9

    \[\leadsto \left(x \cdot \frac{\color{blue}{\left(\sqrt[3]{2} \cdot {2}^{0.3333333333333333}\right) \cdot \frac{1}{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\frac{\sqrt[3]{2}}{\sqrt[3]{y - t}}}{\sqrt[3]{z}}\]
  14. Applied times-frac_binary64_165971.9

    \[\leadsto \left(x \cdot \color{blue}{\left(\frac{\sqrt[3]{2} \cdot {2}^{0.3333333333333333}}{\sqrt[3]{z}} \cdot \frac{\frac{1}{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}}{\sqrt[3]{z}}\right)}\right) \cdot \frac{\frac{\sqrt[3]{2}}{\sqrt[3]{y - t}}}{\sqrt[3]{z}}\]
  15. Applied associate-*r*_binary64_165312.7

    \[\leadsto \color{blue}{\left(\left(x \cdot \frac{\sqrt[3]{2} \cdot {2}^{0.3333333333333333}}{\sqrt[3]{z}}\right) \cdot \frac{\frac{1}{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}}{\sqrt[3]{z}}\right)} \cdot \frac{\frac{\sqrt[3]{2}}{\sqrt[3]{y - t}}}{\sqrt[3]{z}}\]
  16. Simplified2.5

    \[\leadsto \left(\color{blue}{\left(x \cdot \frac{{2}^{0.6666666666666666}}{\sqrt[3]{z}}\right)} \cdot \frac{\frac{1}{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}}{\sqrt[3]{z}}\right) \cdot \frac{\frac{\sqrt[3]{2}}{\sqrt[3]{y - t}}}{\sqrt[3]{z}}\]
  17. Final simplification2.5

    \[\leadsto \left(\left(x \cdot \frac{{2}^{0.6666666666666666}}{\sqrt[3]{z}}\right) \cdot \frac{\frac{1}{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}}}{\sqrt[3]{z}}\right) \cdot \frac{\frac{\sqrt[3]{2}}{\sqrt[3]{y - t}}}{\sqrt[3]{z}}\]

Reproduce

herbie shell --seed 2020292 
(FPCore (x y z t)
  :name "Linear.Projection:infinitePerspective from linear-1.19.1.3, A"
  :precision binary64

  :herbie-target
  (if (< (/ (* x 2.0) (- (* y z) (* t z))) -2.559141628295061e-13) (* (/ x (* (- y t) z)) 2.0) (if (< (/ (* x 2.0) (- (* y z) (* t z))) 1.0450278273301259e-269) (/ (* (/ x z) 2.0) (- y t)) (* (/ x (* (- y t) z)) 2.0)))

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