Average Error: 7.1 → 1.7
Time: 18.5s
Precision: binary64
Cost: 40000
\[\frac{x \cdot 2}{y \cdot z - t \cdot z}\]
\[\left(x \cdot \frac{\sqrt[3]{\frac{2}{y - t}} \cdot \sqrt[3]{\frac{2}{y - t}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{\frac{2}{y - t}}}{\sqrt[3]{z}}\]
\frac{x \cdot 2}{y \cdot z - t \cdot z}
\left(x \cdot \frac{\sqrt[3]{\frac{2}{y - t}} \cdot \sqrt[3]{\frac{2}{y - t}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{\frac{2}{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
   (/ (* (cbrt (/ 2.0 (- y t))) (cbrt (/ 2.0 (- y t)))) (* (cbrt z) (cbrt z))))
  (/ (cbrt (/ 2.0 (- 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 * ((cbrt(2.0 / (y - t)) * cbrt(2.0 / (y - t))) / (cbrt(z) * cbrt(z)))) * (cbrt(2.0 / (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

Original7.1
Target2.3
Herbie1.7
\[\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}\]

Alternatives

Alternative 1
Error4.3
Cost66368
\[\left(\left(x \cdot \left(\sqrt[3]{\frac{2}{y - t}} \cdot \sqrt[3]{\frac{2}{y - t}}\right)\right) \cdot \frac{\sqrt[3]{\sqrt[3]{\frac{2}{y - t}} \cdot \sqrt[3]{\frac{2}{y - t}}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}\right) \cdot \frac{\sqrt[3]{\sqrt[3]{\frac{2}{y - t}}}}{\sqrt[3]{z}}\]
Alternative 2
Error56.1
Cost52416
\[\left(\sqrt{x} \cdot \frac{\frac{\sqrt{2}}{\sqrt{y - t}}}{\sqrt{z}}\right) \cdot \left(\sqrt{x} \cdot \frac{\frac{\sqrt{2}}{\sqrt{y - t}}}{\sqrt{z}}\right)\]
Alternative 3
Error56.2
Cost52288
\[\left(x \cdot \frac{\frac{\sqrt{2}}{\sqrt{z}}}{\sqrt{y} + \sqrt{t}}\right) \cdot \frac{\frac{\sqrt{2}}{\sqrt{y} - \sqrt{t}}}{\sqrt{z}}\]
Alternative 4
Error5.9
Cost46912
\[\left(\left(x \cdot \left(\sqrt[3]{\frac{2}{y - t}} \cdot \sqrt[3]{\frac{2}{y - t}}\right)\right) \cdot \sqrt[3]{\sqrt[3]{\frac{2}{y - t}} \cdot \sqrt[3]{\frac{2}{y - t}}}\right) \cdot \frac{\sqrt[3]{\sqrt[3]{\frac{2}{y - t}}}}{z}\]
Alternative 5
Error32.8
Cost40256
\[\sqrt{\frac{\sqrt[3]{\frac{2}{y - t}}}{z}} \cdot \left(\left(x \cdot \left(\sqrt[3]{\frac{2}{y - t}} \cdot \sqrt[3]{\frac{2}{y - t}}\right)\right) \cdot \sqrt{\frac{\sqrt[3]{\frac{2}{y - t}}}{z}}\right)\]
Alternative 6
Error56.1
Cost39616
\[\left(\sqrt{x} \cdot \frac{\sqrt{\frac{2}{y - t}}}{\sqrt{z}}\right) \cdot \left(\sqrt{x} \cdot \frac{\sqrt{\frac{2}{y - t}}}{\sqrt{z}}\right)\]
Alternative 7
Error49.4
Cost39360
\[\left(x \cdot \frac{\sqrt{2}}{\sqrt{y} + \sqrt{t}}\right) \cdot \frac{\frac{\sqrt{2}}{\sqrt{y} - \sqrt{t}}}{z}\]
Alternative 8
Error4.9
Cost27072
\[\left(\sqrt[3]{\frac{2}{y - t}} \cdot \left(x \cdot \left(\sqrt[3]{\frac{2}{y - t}} \cdot \sqrt[3]{2}\right)\right)\right) \cdot \frac{\sqrt[3]{\frac{1}{y - t}}}{z}\]
Alternative 9
Error48.2
Cost26560
\[\frac{x}{\sqrt{y - t} \cdot \sqrt{z}} \cdot \frac{\frac{2}{\sqrt{y - t}}}{\sqrt{z}}\]
Alternative 10
Error6.3
Cost21056
\[\sqrt[3]{x \cdot \frac{\frac{2}{y - t}}{z}} \cdot \left(\sqrt[3]{x \cdot \frac{\frac{2}{y - t}}{z}} \cdot \sqrt[3]{x \cdot \frac{\frac{2}{y - t}}{z}}\right)\]
Alternative 11
Error6.5
Cost21056
\[\sqrt[3]{\frac{x \cdot \frac{2}{y - t}}{z}} \cdot \left(\sqrt[3]{\frac{x \cdot \frac{2}{y - t}}{z}} \cdot \sqrt[3]{\frac{x \cdot \frac{2}{y - t}}{z}}\right)\]
Alternative 12
Error5.0
Cost20544
\[\left(x \cdot \left(\sqrt[3]{\frac{2}{y - t}} \cdot \sqrt[3]{\frac{2}{y - t}}\right)\right) \cdot \frac{\sqrt[3]{\frac{2}{y - t}}}{z}\]
Alternative 13
Error4.9
Cost20288
\[\frac{x}{\sqrt[3]{y - t} \cdot \sqrt[3]{y - t}} \cdot \frac{\frac{2}{\sqrt[3]{y - t}}}{z}\]
Alternative 14
Error46.8
Cost14272
\[\left(x \cdot \frac{2}{{y}^{3} - {t}^{3}}\right) \cdot \frac{y \cdot y + \left(t \cdot t + y \cdot t\right)}{z}\]
Alternative 15
Error26.4
Cost14016
\[\sqrt{\frac{x \cdot \frac{2}{y - t}}{z}} \cdot \sqrt{\frac{x \cdot \frac{2}{y - t}}{z}}\]
Alternative 16
Error34.3
Cost13760
\[\left(x \cdot \sqrt{\frac{2}{y - t}}\right) \cdot \frac{\sqrt{\frac{2}{y - t}}}{z}\]
Alternative 17
Error34.7
Cost13632
\[x \cdot \left(\frac{1}{\sqrt{z}} \cdot \frac{\frac{2}{y - t}}{\sqrt{z}}\right)\]
Alternative 18
Error34.3
Cost13632
\[\frac{x}{\sqrt{y - t}} \cdot \frac{\frac{2}{\sqrt{y - t}}}{z}\]
Alternative 19
Error35.0
Cost13504
\[\sqrt{x} \cdot \left(\sqrt{x} \cdot \frac{\frac{2}{y - t}}{z}\right)\]
Alternative 20
Error33.9
Cost13504
\[\frac{\frac{2}{y - t}}{\sqrt{z}} \cdot \frac{x}{\sqrt{z}}\]
Alternative 21
Error6.0
Cost13504
\[\left(x \cdot \sqrt{2}\right) \cdot \frac{\frac{\sqrt{2}}{y - t}}{z}\]
Alternative 22
Error32.1
Cost13376
\[\frac{e^{\log \left(x \cdot \frac{2}{y - t}\right)}}{z}\]
Alternative 23
Error29.3
Cost1088
\[x \cdot \frac{\frac{2}{y \cdot y - t \cdot t}}{\frac{z}{y + t}}\]
Alternative 24
Error29.6
Cost1088
\[x \cdot \left(\frac{2}{y \cdot y - t \cdot t} \cdot \frac{y + t}{z}\right)\]
Alternative 25
Error31.0
Cost1088
\[\frac{y + t}{z} \cdot \left(x \cdot \frac{2}{y \cdot y - t \cdot t}\right)\]
Alternative 26
Error35.3
Cost960
\[\frac{2}{z} \cdot \left(\frac{x}{y} + \frac{x \cdot t}{y \cdot y}\right)\]
Alternative 27
Error34.1
Cost960
\[-2 \cdot \left(\frac{x}{z} \cdot \left(\frac{1}{t} + \frac{y}{t \cdot t}\right)\right)\]
Alternative 28
Error7.1
Cost704
\[\frac{x \cdot 2}{y \cdot z - t \cdot z}\]
Alternative 29
Error6.1
Cost704
\[x \cdot \frac{1}{\frac{z}{\frac{2}{y - t}}}\]
Alternative 30
Error5.9
Cost704
\[\left(x \cdot \frac{2}{y - t}\right) \cdot \frac{1}{z}\]
Alternative 31
Error6.2
Cost704
\[\frac{1}{\frac{z}{x \cdot \frac{2}{y - t}}}\]
Alternative 32
Error5.8
Cost576
\[\frac{x \cdot \frac{2}{y - t}}{z}\]
Alternative 33
Error5.7
Cost576
\[x \cdot \frac{\frac{2}{y - t}}{z}\]
Alternative 34
Error6.0
Cost576
\[x \cdot \frac{2}{\left(y - t\right) \cdot z}\]
Alternative 35
Error5.8
Cost576
\[\frac{\frac{x \cdot 2}{y - t}}{z}\]
Alternative 36
Error30.9
Cost448
\[x \cdot \frac{\frac{2}{y}}{z}\]
Alternative 37
Error31.2
Cost448
\[\frac{x \cdot \frac{2}{y}}{z}\]
Alternative 38
Error31.8
Cost448
\[\frac{x}{t} \cdot \frac{-2}{z}\]
Alternative 39
Error31.9
Cost448
\[x \cdot \frac{\frac{-2}{t}}{z}\]
Alternative 40
Error31.0
Cost448
\[x \cdot \frac{2}{y \cdot z}\]
Alternative 41
Error32.1
Cost448
\[x \cdot \frac{-2}{t \cdot z}\]
Alternative 42
Error30.9
Cost448
\[2 \cdot \frac{x}{y \cdot z}\]
Alternative 43
Error32.0
Cost448
\[-2 \cdot \frac{x}{t \cdot z}\]
Alternative 44
Error31.8
Cost448
\[\frac{x \cdot \frac{-2}{t}}{z}\]
Alternative 45
Error31.2
Cost448
\[\frac{2 \cdot \frac{x}{y}}{z}\]
Alternative 46
Error31.8
Cost448
\[\frac{\frac{x}{t} \cdot -2}{z}\]
Alternative 47
Error61.7
Cost64
\[1\]
Alternative 48
Error45.4
Cost64
\[0\]
Alternative 49
Error61.8
Cost64
\[-1\]

Error

Derivation

  1. Initial program 7.1

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

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

    \[\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_137596.5

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

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

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

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

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

Reproduce

herbie shell --seed 2021042 
(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))))