Average Error: 24.0 → 6.5
Time: 16.9s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -3.962990925915687 \cdot 10^{+91}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \le 3.471068194478418 \cdot 10^{+142}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\\ \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 -3.962990925915687 \cdot 10^{+91}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r14235655 = x;
        double r14235656 = y;
        double r14235657 = r14235655 * r14235656;
        double r14235658 = z;
        double r14235659 = r14235657 * r14235658;
        double r14235660 = r14235658 * r14235658;
        double r14235661 = t;
        double r14235662 = a;
        double r14235663 = r14235661 * r14235662;
        double r14235664 = r14235660 - r14235663;
        double r14235665 = sqrt(r14235664);
        double r14235666 = r14235659 / r14235665;
        return r14235666;
}

double f(double x, double y, double z, double t, double a) {
        double r14235667 = z;
        double r14235668 = -3.962990925915687e+91;
        bool r14235669 = r14235667 <= r14235668;
        double r14235670 = x;
        double r14235671 = y;
        double r14235672 = -r14235671;
        double r14235673 = r14235670 * r14235672;
        double r14235674 = 3.471068194478418e+142;
        bool r14235675 = r14235667 <= r14235674;
        double r14235676 = r14235670 * r14235671;
        double r14235677 = r14235667 * r14235667;
        double r14235678 = t;
        double r14235679 = a;
        double r14235680 = r14235678 * r14235679;
        double r14235681 = r14235677 - r14235680;
        double r14235682 = sqrt(r14235681);
        double r14235683 = r14235667 / r14235682;
        double r14235684 = r14235676 * r14235683;
        double r14235685 = r14235675 ? r14235684 : r14235676;
        double r14235686 = r14235669 ? r14235673 : r14235685;
        return r14235686;
}

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.0
Target8.1
Herbie6.5
\[\begin{array}{l} \mathbf{if}\;z \lt -3.1921305903852764 \cdot 10^{+46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 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 3 regimes
  2. if z < -3.962990925915687e+91

    1. Initial program 42.0

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

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

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

    if -3.962990925915687e+91 < z < 3.471068194478418e+142

    1. Initial program 10.8

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

      \[\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.8

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

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

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

    if 3.471068194478418e+142 < z

    1. Initial program 50.7

      \[\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}{x \cdot y}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification6.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -3.962990925915687 \cdot 10^{+91}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \le 3.471068194478418 \cdot 10^{+142}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

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