Average Error: 24.7 → 6.3
Time: 9.6s
Precision: binary64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
\[\begin{array}{l} \mathbf{if}\;z \leq -4.988987613997654 \cdot 10^{+154}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \leq -5.653067374710907 \cdot 10^{-203}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \leq 3.916159283675478 \cdot 10^{-139}:\\ \;\;\;\;\left(\left(y \cdot x\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right) \cdot \frac{\sqrt[3]{z}}{\mathsf{hypot}\left(\sqrt{-t \cdot a}, z\right)}\\ \mathbf{elif}\;z \leq 1.216315346182611 \cdot 10^{+31}:\\ \;\;\;\;\left(y \cdot \left(z \cdot x\right)\right) \cdot \sqrt{\frac{1}{{z}^{2} - t \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \leq -4.988987613997654 \cdot 10^{+154}:\\
\;\;\;\;-y \cdot x\\

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

\mathbf{elif}\;z \leq 3.916159283675478 \cdot 10^{-139}:\\
\;\;\;\;\left(\left(y \cdot x\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right) \cdot \frac{\sqrt[3]{z}}{\mathsf{hypot}\left(\sqrt{-t \cdot a}, z\right)}\\

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

\mathbf{else}:\\
\;\;\;\;y \cdot x\\


\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 -4.988987613997654e+154)
   (- (* y x))
   (if (<= z -5.653067374710907e-203)
     (* (* y x) (/ z (sqrt (- (* z z) (* t a)))))
     (if (<= z 3.916159283675478e-139)
       (*
        (* (* y x) (* (cbrt z) (cbrt z)))
        (/ (cbrt z) (hypot (sqrt (- (* t a))) z)))
       (if (<= z 1.216315346182611e+31)
         (* (* y (* z x)) (sqrt (/ 1.0 (- (pow z 2.0) (* t a)))))
         (* y x))))))
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 <= -4.988987613997654e+154) {
		tmp = -(y * x);
	} else if (z <= -5.653067374710907e-203) {
		tmp = (y * x) * (z / sqrt(((z * z) - (t * a))));
	} else if (z <= 3.916159283675478e-139) {
		tmp = ((y * x) * (cbrt(z) * cbrt(z))) * (cbrt(z) / hypot(sqrt(-(t * a)), z));
	} else if (z <= 1.216315346182611e+31) {
		tmp = (y * (z * x)) * sqrt((1.0 / (pow(z, 2.0) - (t * a))));
	} else {
		tmp = y * x;
	}
	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
Target7.9
Herbie6.3
\[\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 5 regimes
  2. if z < -4.988987613997654e154

    1. Initial program 54.4

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

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

      \[\leadsto \color{blue}{-y \cdot x} \]

    if -4.988987613997654e154 < z < -5.6530673747109071e-203

    1. Initial program 9.4

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Applied *-un-lft-identity_binary649.4

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

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

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

    if -5.6530673747109071e-203 < z < 3.91615928367547766e-139

    1. Initial program 17.2

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}} \]
    2. Applied *-un-lft-identity_binary6417.2

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}} \]
    5. Simplified18.4

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

      \[\leadsto \left(y \cdot x\right) \cdot \color{blue}{\frac{z}{\mathsf{hypot}\left(\sqrt{-a \cdot t}, z\right)}} \]
    7. Applied *-un-lft-identity_binary6414.8

      \[\leadsto \left(y \cdot x\right) \cdot \frac{z}{\color{blue}{1 \cdot \mathsf{hypot}\left(\sqrt{-a \cdot t}, z\right)}} \]
    8. Applied add-cube-cbrt_binary6415.2

      \[\leadsto \left(y \cdot x\right) \cdot \frac{\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}}}{1 \cdot \mathsf{hypot}\left(\sqrt{-a \cdot t}, z\right)} \]
    9. Applied times-frac_binary6415.2

      \[\leadsto \left(y \cdot x\right) \cdot \color{blue}{\left(\frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{1} \cdot \frac{\sqrt[3]{z}}{\mathsf{hypot}\left(\sqrt{-a \cdot t}, z\right)}\right)} \]
    10. Applied associate-*r*_binary6412.6

      \[\leadsto \color{blue}{\left(\left(y \cdot x\right) \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{1}\right) \cdot \frac{\sqrt[3]{z}}{\mathsf{hypot}\left(\sqrt{-a \cdot t}, z\right)}} \]
    11. Simplified12.6

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

    if 3.91615928367547766e-139 < z < 1.21631534618261101e31

    1. Initial program 8.5

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

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

    if 1.21631534618261101e31 < z

    1. Initial program 35.7

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

      \[\leadsto \color{blue}{y \cdot x} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification6.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.988987613997654 \cdot 10^{+154}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \leq -5.653067374710907 \cdot 10^{-203}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \leq 3.916159283675478 \cdot 10^{-139}:\\ \;\;\;\;\left(\left(y \cdot x\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right) \cdot \frac{\sqrt[3]{z}}{\mathsf{hypot}\left(\sqrt{-t \cdot a}, z\right)}\\ \mathbf{elif}\;z \leq 1.216315346182611 \cdot 10^{+31}:\\ \;\;\;\;\left(y \cdot \left(z \cdot x\right)\right) \cdot \sqrt{\frac{1}{{z}^{2} - t \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \]

Reproduce

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