Average Error: 25.0 → 6.4
Time: 10.3s
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.002837198668899603186184426685314231232 \cdot 10^{60}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \le 3.938152743281577115008790785650092236667 \cdot 10^{96}:\\ \;\;\;\;\frac{x}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \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.002837198668899603186184426685314231232 \cdot 10^{60}:\\
\;\;\;\;x \cdot \left(-y\right)\\

\mathbf{elif}\;z \le 3.938152743281577115008790785650092236667 \cdot 10^{96}:\\
\;\;\;\;\frac{x}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r369841 = x;
        double r369842 = y;
        double r369843 = r369841 * r369842;
        double r369844 = z;
        double r369845 = r369843 * r369844;
        double r369846 = r369844 * r369844;
        double r369847 = t;
        double r369848 = a;
        double r369849 = r369847 * r369848;
        double r369850 = r369846 - r369849;
        double r369851 = sqrt(r369850);
        double r369852 = r369845 / r369851;
        return r369852;
}

double f(double x, double y, double z, double t, double a) {
        double r369853 = z;
        double r369854 = -1.0028371986688996e+60;
        bool r369855 = r369853 <= r369854;
        double r369856 = x;
        double r369857 = y;
        double r369858 = -r369857;
        double r369859 = r369856 * r369858;
        double r369860 = 3.938152743281577e+96;
        bool r369861 = r369853 <= r369860;
        double r369862 = r369853 * r369853;
        double r369863 = t;
        double r369864 = a;
        double r369865 = r369863 * r369864;
        double r369866 = r369862 - r369865;
        double r369867 = sqrt(r369866);
        double r369868 = sqrt(r369867);
        double r369869 = cbrt(r369853);
        double r369870 = r369869 * r369869;
        double r369871 = r369868 / r369870;
        double r369872 = r369856 / r369871;
        double r369873 = r369868 / r369869;
        double r369874 = r369857 / r369873;
        double r369875 = r369872 * r369874;
        double r369876 = r369856 * r369857;
        double r369877 = r369861 ? r369875 : r369876;
        double r369878 = r369855 ? r369859 : r369877;
        return r369878;
}

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

Original25.0
Target7.9
Herbie6.4
\[\begin{array}{l} \mathbf{if}\;z \lt -3.192130590385276419686361646843883646209 \cdot 10^{46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.976268120920894210257945708950453212935 \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.0028371986688996e+60

    1. Initial program 39.0

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied associate-/l*35.9

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity35.9

      \[\leadsto \frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{\color{blue}{1 \cdot z}}}\]
    6. Applied *-un-lft-identity35.9

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

      \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{\sqrt{1} \cdot \sqrt{z \cdot z - t \cdot a}}}{1 \cdot z}}\]
    8. Applied times-frac35.9

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

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

      \[\leadsto \color{blue}{x} \cdot \frac{y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\]
    11. Taylor expanded around -inf 3.4

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

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

    if -1.0028371986688996e+60 < z < 3.938152743281577e+96

    1. Initial program 11.4

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied associate-/l*10.1

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt10.8

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

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}} \cdot \frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}}\]
    9. Applied times-frac9.1

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

    if 3.938152743281577e+96 < z

    1. Initial program 43.9

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied associate-/l*41.1

      \[\leadsto \color{blue}{\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity41.1

      \[\leadsto \frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{\color{blue}{1 \cdot z}}}\]
    6. Applied *-un-lft-identity41.1

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

      \[\leadsto \frac{x \cdot y}{\frac{\color{blue}{\sqrt{1} \cdot \sqrt{z \cdot z - t \cdot a}}}{1 \cdot z}}\]
    8. Applied times-frac41.1

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

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

      \[\leadsto \color{blue}{x} \cdot \frac{y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\]
    11. Taylor expanded around inf 2.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.002837198668899603186184426685314231232 \cdot 10^{60}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \le 3.938152743281577115008790785650092236667 \cdot 10^{96}:\\ \;\;\;\;\frac{x}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{\sqrt{\sqrt{z \cdot z - t \cdot a}}}{\sqrt[3]{z}}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019350 +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)))))