Average Error: 24.6 → 6.1
Time: 18.7s
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 \left(-y\right)\\ \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 \left(-y\right)\\

\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 r237641 = x;
        double r237642 = y;
        double r237643 = r237641 * r237642;
        double r237644 = z;
        double r237645 = r237643 * r237644;
        double r237646 = r237644 * r237644;
        double r237647 = t;
        double r237648 = a;
        double r237649 = r237647 * r237648;
        double r237650 = r237646 - r237649;
        double r237651 = sqrt(r237650);
        double r237652 = r237645 / r237651;
        return r237652;
}

double f(double x, double y, double z, double t, double a) {
        double r237653 = z;
        double r237654 = -5.1995172941306935e+153;
        bool r237655 = r237653 <= r237654;
        double r237656 = x;
        double r237657 = y;
        double r237658 = -r237657;
        double r237659 = r237656 * r237658;
        double r237660 = 2.7405676072746077e+132;
        bool r237661 = r237653 <= r237660;
        double r237662 = r237653 * r237653;
        double r237663 = t;
        double r237664 = a;
        double r237665 = r237663 * r237664;
        double r237666 = r237662 - r237665;
        double r237667 = sqrt(r237666);
        double r237668 = r237667 / r237653;
        double r237669 = cbrt(r237668);
        double r237670 = r237656 / r237669;
        double r237671 = r237670 / r237669;
        double r237672 = r237657 / r237669;
        double r237673 = r237671 * r237672;
        double r237674 = r237656 * r237657;
        double r237675 = r237661 ? r237673 : r237674;
        double r237676 = r237655 ? r237659 : r237675;
        return r237676;
}

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. Taylor expanded around -inf 1.5

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

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

    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 \left(-y\right)\\ \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)))))