Average Error: 24.7 → 7.0
Time: 7.2s
Precision: binary64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \leq -5.6186452759089954 \cdot 10^{+135}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\right)\\ \mathbf{elif}\;z \leq -2.5938209576510873 \cdot 10^{-191}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{elif}\;z \leq -8.151714677345732 \cdot 10^{-243}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\right)\\ \mathbf{elif}\;z \leq 2.8288936700686717 \cdot 10^{+75}:\\ \;\;\;\;y \cdot \left(z \cdot \frac{x}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{\frac{z + \left(t \cdot \frac{a}{z}\right) \cdot -0.5}{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 -5.6186452759089954 \cdot 10^{+135}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\right)\\

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

\mathbf{elif}\;z \leq -8.151714677345732 \cdot 10^{-243}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\right)\\

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

\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{\frac{z + \left(t \cdot \frac{a}{z}\right) \cdot -0.5}{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 -5.6186452759089954e+135)
   (* x (* y (/ z (- (* 0.5 (* t (/ a z))) z))))
   (if (<= z -2.5938209576510873e-191)
     (* x (* y (/ z (sqrt (- (* z z) (* t a))))))
     (if (<= z -8.151714677345732e-243)
       (* x (* y (/ z (- (* 0.5 (* t (/ a z))) z))))
       (if (<= z 2.8288936700686717e+75)
         (* y (* z (/ x (sqrt (- (* z z) (* t a))))))
         (* y (/ x (/ (+ z (* (* t (/ a z)) -0.5)) z))))))))
double code(double x, double y, double z, double t, double a) {
	return (((double) (((double) (x * y)) * z)) / ((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a)))))));
}
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -5.6186452759089954e+135)) {
		tmp = ((double) (x * ((double) (y * (z / ((double) (((double) (0.5 * ((double) (t * (a / z))))) - z)))))));
	} else {
		double tmp_1;
		if ((z <= -2.5938209576510873e-191)) {
			tmp_1 = ((double) (x * ((double) (y * (z / ((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a)))))))))));
		} else {
			double tmp_2;
			if ((z <= -8.151714677345732e-243)) {
				tmp_2 = ((double) (x * ((double) (y * (z / ((double) (((double) (0.5 * ((double) (t * (a / z))))) - z)))))));
			} else {
				double tmp_3;
				if ((z <= 2.8288936700686717e+75)) {
					tmp_3 = ((double) (y * ((double) (z * (x / ((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a)))))))))));
				} else {
					tmp_3 = ((double) (y * (x / (((double) (z + ((double) (((double) (t * (a / z))) * -0.5)))) / z))));
				}
				tmp_2 = tmp_3;
			}
			tmp_1 = tmp_2;
		}
		tmp = tmp_1;
	}
	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.7
Herbie7.0
\[\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 < -5.61864527590899535e135 or -2.5938209576510873e-191 < z < -8.1517146773457319e-243

    1. Initial program Error: 44.6 bits

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. SimplifiedError: 43.6 bits

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}\]
    3. Taylor expanded around -inf Error: 10.0 bits

      \[\leadsto x \cdot \left(y \cdot \frac{z}{\color{blue}{0.5 \cdot \frac{a \cdot t}{z} - z}}\right)\]
    4. SimplifiedError: 6.2 bits

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

    if -5.61864527590899535e135 < z < -2.5938209576510873e-191

    1. Initial program Error: 9.7 bits

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. SimplifiedError: 5.8 bits

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

    if -8.1517146773457319e-243 < z < 2.8288936700686717e75

    1. Initial program Error: 11.2 bits

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. SimplifiedError: 10.4 bits

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}\]
    3. Using strategy rm
    4. Applied add-cube-cbrtError: 11.0 bits

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right)} \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\]
    5. Applied associate-*l*Error: 11.0 bits

      \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\right)}\]
    6. SimplifiedError: 10.5 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \color{blue}{\left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)\right)}\]
    7. Using strategy rm
    8. Applied pow1Error: 10.5 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \color{blue}{{\left(\sqrt[3]{x}\right)}^{1}}\right)\right)\]
    9. Applied pow1Error: 10.5 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(y \cdot \left(\color{blue}{{\left(\frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}^{1}} \cdot {\left(\sqrt[3]{x}\right)}^{1}\right)\right)\]
    10. Applied pow-prod-downError: 10.5 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(y \cdot \color{blue}{{\left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)}^{1}}\right)\]
    11. Applied pow1Error: 10.5 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\color{blue}{{y}^{1}} \cdot {\left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)}^{1}\right)\]
    12. Applied pow-prod-downError: 10.5 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \color{blue}{{\left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)\right)}^{1}}\]
    13. Applied pow1Error: 10.5 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \color{blue}{{\left(\sqrt[3]{x}\right)}^{1}}\right) \cdot {\left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)\right)}^{1}\]
    14. Applied pow1Error: 10.5 bits

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x}\right)}^{1}} \cdot {\left(\sqrt[3]{x}\right)}^{1}\right) \cdot {\left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)\right)}^{1}\]
    15. Applied pow-prod-downError: 10.5 bits

      \[\leadsto \color{blue}{{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}^{1}} \cdot {\left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)\right)}^{1}\]
    16. Applied pow-prod-downError: 10.5 bits

      \[\leadsto \color{blue}{{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)\right)\right)}^{1}}\]
    17. SimplifiedError: 10.6 bits

      \[\leadsto {\color{blue}{\left(y \cdot \frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\right)}}^{1}\]
    18. Using strategy rm
    19. Applied associate-/r/Error: 11.9 bits

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

    if 2.8288936700686717e75 < z

    1. Initial program Error: 40.6 bits

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. SimplifiedError: 37.9 bits

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}\]
    3. Using strategy rm
    4. Applied add-cube-cbrtError: 38.2 bits

      \[\leadsto \color{blue}{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}\right)} \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\]
    5. Applied associate-*l*Error: 38.2 bits

      \[\leadsto \color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\right)}\]
    6. SimplifiedError: 38.2 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \color{blue}{\left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)\right)}\]
    7. Using strategy rm
    8. Applied pow1Error: 38.2 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \color{blue}{{\left(\sqrt[3]{x}\right)}^{1}}\right)\right)\]
    9. Applied pow1Error: 38.2 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(y \cdot \left(\color{blue}{{\left(\frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}^{1}} \cdot {\left(\sqrt[3]{x}\right)}^{1}\right)\right)\]
    10. Applied pow-prod-downError: 38.2 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(y \cdot \color{blue}{{\left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)}^{1}}\right)\]
    11. Applied pow1Error: 38.2 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\color{blue}{{y}^{1}} \cdot {\left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)}^{1}\right)\]
    12. Applied pow-prod-downError: 38.2 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \color{blue}{{\left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)\right)}^{1}}\]
    13. Applied pow1Error: 38.2 bits

      \[\leadsto \left(\sqrt[3]{x} \cdot \color{blue}{{\left(\sqrt[3]{x}\right)}^{1}}\right) \cdot {\left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)\right)}^{1}\]
    14. Applied pow1Error: 38.2 bits

      \[\leadsto \left(\color{blue}{{\left(\sqrt[3]{x}\right)}^{1}} \cdot {\left(\sqrt[3]{x}\right)}^{1}\right) \cdot {\left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)\right)}^{1}\]
    15. Applied pow-prod-downError: 38.2 bits

      \[\leadsto \color{blue}{{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}^{1}} \cdot {\left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)\right)}^{1}\]
    16. Applied pow-prod-downError: 38.2 bits

      \[\leadsto \color{blue}{{\left(\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(y \cdot \left(\frac{z}{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt[3]{x}\right)\right)\right)}^{1}}\]
    17. SimplifiedError: 37.9 bits

      \[\leadsto {\color{blue}{\left(y \cdot \frac{x}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\right)}}^{1}\]
    18. Taylor expanded around inf Error: 5.6 bits

      \[\leadsto {\left(y \cdot \frac{x}{\frac{\color{blue}{z - 0.5 \cdot \frac{a \cdot t}{z}}}{z}}\right)}^{1}\]
    19. SimplifiedError: 2.7 bits

      \[\leadsto {\left(y \cdot \frac{x}{\frac{\color{blue}{z + \left(\frac{a}{z} \cdot t\right) \cdot -0.5}}{z}}\right)}^{1}\]
  3. Recombined 4 regimes into one program.
  4. Final simplificationError: 7.0 bits

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.6186452759089954 \cdot 10^{+135}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\right)\\ \mathbf{elif}\;z \leq -2.5938209576510873 \cdot 10^{-191}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{elif}\;z \leq -8.151714677345732 \cdot 10^{-243}:\\ \;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\right)\\ \mathbf{elif}\;z \leq 2.8288936700686717 \cdot 10^{+75}:\\ \;\;\;\;y \cdot \left(z \cdot \frac{x}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{\frac{z + \left(t \cdot \frac{a}{z}\right) \cdot -0.5}{z}}\\ \end{array}\]

Reproduce

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