Average Error: 24.6 → 6.1
Time: 18.2s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -5.199517294130693504281960722840695045262 \cdot 10^{153}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 2.740567607274607673932213174980833764924 \cdot 10^{132}:\\ \;\;\;\;\frac{\frac{x}{\sqrt[3]{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}}{\sqrt[3]{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \cdot \frac{y}{\sqrt[3]{\frac{\sqrt{z \cdot z - t \cdot a}}{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 -5.199517294130693504281960722840695045262 \cdot 10^{153}:\\
\;\;\;\;-x \cdot y\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r271743 = x;
        double r271744 = y;
        double r271745 = r271743 * r271744;
        double r271746 = z;
        double r271747 = r271745 * r271746;
        double r271748 = r271746 * r271746;
        double r271749 = t;
        double r271750 = a;
        double r271751 = r271749 * r271750;
        double r271752 = r271748 - r271751;
        double r271753 = sqrt(r271752);
        double r271754 = r271747 / r271753;
        return r271754;
}

double f(double x, double y, double z, double t, double a) {
        double r271755 = z;
        double r271756 = -5.1995172941306935e+153;
        bool r271757 = r271755 <= r271756;
        double r271758 = x;
        double r271759 = y;
        double r271760 = r271758 * r271759;
        double r271761 = -r271760;
        double r271762 = 2.7405676072746077e+132;
        bool r271763 = r271755 <= r271762;
        double r271764 = r271755 * r271755;
        double r271765 = t;
        double r271766 = a;
        double r271767 = r271765 * r271766;
        double r271768 = r271764 - r271767;
        double r271769 = sqrt(r271768);
        double r271770 = r271769 / r271755;
        double r271771 = cbrt(r271770);
        double r271772 = r271758 / r271771;
        double r271773 = r271772 / r271771;
        double r271774 = r271759 / r271771;
        double r271775 = r271773 * r271774;
        double r271776 = r271763 ? r271775 : r271760;
        double r271777 = r271757 ? r271761 : r271776;
        return r271777;
}

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.6
Target7.8
Herbie6.1
\[\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 < -5.1995172941306935e+153

    1. Initial program 54.5

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

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

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

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

    if -5.1995172941306935e+153 < z < 2.7405676072746077e+132

    1. Initial program 10.7

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

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

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

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

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

    if 2.7405676072746077e+132 < z

    1. Initial program 50.1

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

      \[\leadsto \color{blue}{x \cdot y}\]
    3. Simplified1.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -5.199517294130693504281960722840695045262 \cdot 10^{153}:\\ \;\;\;\;-x \cdot y\\ \mathbf{elif}\;z \le 2.740567607274607673932213174980833764924 \cdot 10^{132}:\\ \;\;\;\;\frac{\frac{x}{\sqrt[3]{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}}{\sqrt[3]{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}} \cdot \frac{y}{\sqrt[3]{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

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

  :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)))))