Average Error: 24.2 → 6.5
Time: 6.0s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -1.1125528044552557 \cdot 10^{144}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 1.09631820124514439 \cdot 10^{69}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{\frac{z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 1\\ \end{array}\]
\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \le -1.1125528044552557 \cdot 10^{144}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

\mathbf{elif}\;z \le 1.09631820124514439 \cdot 10^{69}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{\frac{z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r294801 = x;
        double r294802 = y;
        double r294803 = r294801 * r294802;
        double r294804 = z;
        double r294805 = r294803 * r294804;
        double r294806 = r294804 * r294804;
        double r294807 = t;
        double r294808 = a;
        double r294809 = r294807 * r294808;
        double r294810 = r294806 - r294809;
        double r294811 = sqrt(r294810);
        double r294812 = r294805 / r294811;
        return r294812;
}

double f(double x, double y, double z, double t, double a) {
        double r294813 = z;
        double r294814 = -1.1125528044552557e+144;
        bool r294815 = r294813 <= r294814;
        double r294816 = -1.0;
        double r294817 = x;
        double r294818 = y;
        double r294819 = r294817 * r294818;
        double r294820 = r294816 * r294819;
        double r294821 = 1.0963182012451444e+69;
        bool r294822 = r294813 <= r294821;
        double r294823 = r294813 * r294813;
        double r294824 = t;
        double r294825 = a;
        double r294826 = r294824 * r294825;
        double r294827 = r294823 - r294826;
        double r294828 = sqrt(r294827);
        double r294829 = sqrt(r294828);
        double r294830 = r294813 / r294829;
        double r294831 = r294830 / r294829;
        double r294832 = r294819 * r294831;
        double r294833 = 1.0;
        double r294834 = r294819 * r294833;
        double r294835 = r294822 ? r294832 : r294834;
        double r294836 = r294815 ? r294820 : r294835;
        return r294836;
}

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.2
Target7.8
Herbie6.5
\[\begin{array}{l} \mathbf{if}\;z \lt -3.1921305903852764 \cdot 10^{46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.9762681209208942 \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 3 regimes
  2. if z < -1.1125528044552557e+144

    1. Initial program 51.4

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

      \[\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-prod51.4

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

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

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

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

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

    if -1.1125528044552557e+144 < z < 1.0963182012451444e+69

    1. Initial program 10.9

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

      \[\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-prod10.9

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

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

      \[\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-sqr-sqrt8.9

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

      \[\leadsto \left(x \cdot y\right) \cdot \frac{z}{\color{blue}{\sqrt{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt{\sqrt{z \cdot z - t \cdot a}}}}\]
    10. Applied associate-/r*9.2

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

    if 1.0963182012451444e+69 < z

    1. Initial program 39.2

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

      \[\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-prod39.2

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.1125528044552557 \cdot 10^{144}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 1.09631820124514439 \cdot 10^{69}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{\frac{z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 1\\ \end{array}\]

Reproduce

herbie shell --seed 2020035 +o rules:numerics
(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)))))