Average Error: 24.7 → 7.1
Time: 18.6s
Precision: binary64
\[[x, y]=\mathsf{sort}([x, y])\]
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \leq -2.705239368116784 \cdot 10^{+72}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \leq 7.0143619415122286 \cdot 10^{-304}:\\ \;\;\;\;\left(z \cdot \left(x \cdot y\right)\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \leq 2.8243032036053995 \cdot 10^{+60}:\\ \;\;\;\;x \cdot \left(\left(y \cdot \frac{\sqrt{z}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\right) \cdot \frac{\sqrt{z}}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{z}{z}\\ \end{array}\]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \leq -2.705239368116784 \cdot 10^{+72}:\\
\;\;\;\;-x \cdot y\\

\mathbf{elif}\;z \leq 7.0143619415122286 \cdot 10^{-304}:\\
\;\;\;\;\left(z \cdot \left(x \cdot y\right)\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\\

\mathbf{elif}\;z \leq 2.8243032036053995 \cdot 10^{+60}:\\
\;\;\;\;x \cdot \left(\left(y \cdot \frac{\sqrt{z}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\right) \cdot \frac{\sqrt{z}}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{z}{z}\\

\end{array}
(FPCore (x y z t a)
 :precision binary64
 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2.705239368116784e+72)
   (- (* x y))
   (if (<= z 7.0143619415122286e-304)
     (* (* z (* x y)) (/ 1.0 (sqrt (- (* z z) (* t a)))))
     (if (<= z 2.8243032036053995e+60)
       (*
        x
        (*
         (* y (/ (sqrt z) (sqrt (cbrt (- (* z z) (* t a))))))
         (/ (sqrt z) (fabs (cbrt (- (* z z) (* t a)))))))
       (* (* x y) (/ z z))))))
double code(double x, double y, double z, double t, double a) {
	return ((x * y) * z) / sqrt((z * z) - (t * a));
}
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.705239368116784e+72) {
		tmp = -(x * y);
	} else if (z <= 7.0143619415122286e-304) {
		tmp = (z * (x * y)) * (1.0 / sqrt((z * z) - (t * a)));
	} else if (z <= 2.8243032036053995e+60) {
		tmp = x * ((y * (sqrt(z) / sqrt(cbrt((z * z) - (t * a))))) * (sqrt(z) / fabs(cbrt((z * z) - (t * a)))));
	} else {
		tmp = (x * y) * (z / z);
	}
	return tmp;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original24.7
Target8.0
Herbie7.1
\[\begin{array}{l} \mathbf{if}\;z < -3.1921305903852764 \cdot 10^{+46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z < 5.976268120920894 \cdot 10^{+90}:\\ \;\;\;\;\frac{x \cdot z}{\frac{\sqrt{z \cdot z - a \cdot t}}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array}\]

Derivation

  1. Split input into 4 regimes
  2. if z < -2.705239368116784e72

    1. Initial program 40.5

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Taylor expanded around -inf 2.8

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)}\]

    if -2.705239368116784e72 < z < 7.01436194151222859e-304

    1. Initial program 11.5

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied div-inv_binary64_791811.5

      \[\leadsto \color{blue}{\left(\left(x \cdot y\right) \cdot z\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}}\]

    if 7.01436194151222859e-304 < z < 2.82430320360539952e60

    1. Initial program 11.5

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity_binary64_792111.5

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{\color{blue}{1 \cdot \left(z \cdot z - t \cdot a\right)}}}\]
    4. Applied sqrt-prod_binary64_793711.5

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified10.6

      \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt_binary64_795611.0

      \[\leadsto \left(x \cdot y\right) \cdot \frac{z}{\sqrt{\color{blue}{\left(\sqrt[3]{z \cdot z - t \cdot a} \cdot \sqrt[3]{z \cdot z - t \cdot a}\right) \cdot \sqrt[3]{z \cdot z - t \cdot a}}}}\]
    9. Applied sqrt-prod_binary64_793711.0

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

      \[\leadsto \left(x \cdot y\right) \cdot \frac{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a} \cdot \sqrt[3]{z \cdot z - t \cdot a}} \cdot \sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\]
    11. Applied times-frac_binary64_792711.3

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{\left(\frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a} \cdot \sqrt[3]{z \cdot z - t \cdot a}}} \cdot \frac{\sqrt[3]{z}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\right)}\]
    12. Simplified11.3

      \[\leadsto \left(x \cdot y\right) \cdot \left(\color{blue}{\frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}} \cdot \frac{\sqrt[3]{z}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\right)\]
    13. Using strategy rm
    14. Applied associate-*l*_binary64_786210.3

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \left(\frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|} \cdot \frac{\sqrt[3]{z}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\right)\right)}\]
    15. Simplified10.0

      \[\leadsto x \cdot \color{blue}{\left(y \cdot \frac{z}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}} \cdot \left|\sqrt[3]{z \cdot z - t \cdot a}\right|}\right)}\]
    16. Using strategy rm
    17. Applied add-sqr-sqrt_binary64_794310.0

      \[\leadsto x \cdot \left(y \cdot \frac{\color{blue}{\sqrt{z} \cdot \sqrt{z}}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}} \cdot \left|\sqrt[3]{z \cdot z - t \cdot a}\right|}\right)\]
    18. Applied times-frac_binary64_792710.0

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

      \[\leadsto x \cdot \color{blue}{\left(\left(y \cdot \frac{\sqrt{z}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\right) \cdot \frac{\sqrt{z}}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}\right)}\]

    if 2.82430320360539952e60 < z

    1. Initial program 38.5

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity_binary64_792138.5

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\sqrt{\color{blue}{1 \cdot \left(z \cdot z - t \cdot a\right)}}}\]
    4. Applied sqrt-prod_binary64_793738.5

      \[\leadsto \frac{\left(x \cdot y\right) \cdot z}{\color{blue}{\sqrt{1} \cdot \sqrt{z \cdot z - t \cdot a}}}\]
    5. Applied times-frac_binary64_792736.0

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified36.0

      \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Taylor expanded around inf 3.5

      \[\leadsto \left(x \cdot y\right) \cdot \frac{z}{\color{blue}{z}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification7.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.705239368116784 \cdot 10^{+72}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \leq 7.0143619415122286 \cdot 10^{-304}:\\ \;\;\;\;\left(z \cdot \left(x \cdot y\right)\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \leq 2.8243032036053995 \cdot 10^{+60}:\\ \;\;\;\;x \cdot \left(\left(y \cdot \frac{\sqrt{z}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\right) \cdot \frac{\sqrt{z}}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{z}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2021098 
(FPCore (x y z t a)
  :name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))

  (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))