Average Error: 25.0 → 6.7
Time: 16.8s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -4.796512439373366453310456845924400229459 \cdot 10^{73}:\\ \;\;\;\;\left(x \cdot y\right) \cdot -1\\ \mathbf{elif}\;z \le 4.946971173738666090803109555665692031855 \cdot 10^{105}:\\ \;\;\;\;x \cdot \left(\left(y \cdot z\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \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 -4.796512439373366453310456845924400229459 \cdot 10^{73}:\\
\;\;\;\;\left(x \cdot y\right) \cdot -1\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r160117 = x;
        double r160118 = y;
        double r160119 = r160117 * r160118;
        double r160120 = z;
        double r160121 = r160119 * r160120;
        double r160122 = r160120 * r160120;
        double r160123 = t;
        double r160124 = a;
        double r160125 = r160123 * r160124;
        double r160126 = r160122 - r160125;
        double r160127 = sqrt(r160126);
        double r160128 = r160121 / r160127;
        return r160128;
}

double f(double x, double y, double z, double t, double a) {
        double r160129 = z;
        double r160130 = -4.7965124393733665e+73;
        bool r160131 = r160129 <= r160130;
        double r160132 = x;
        double r160133 = y;
        double r160134 = r160132 * r160133;
        double r160135 = -1.0;
        double r160136 = r160134 * r160135;
        double r160137 = 4.946971173738666e+105;
        bool r160138 = r160129 <= r160137;
        double r160139 = r160133 * r160129;
        double r160140 = 1.0;
        double r160141 = r160129 * r160129;
        double r160142 = t;
        double r160143 = a;
        double r160144 = r160142 * r160143;
        double r160145 = r160141 - r160144;
        double r160146 = sqrt(r160145);
        double r160147 = r160140 / r160146;
        double r160148 = r160139 * r160147;
        double r160149 = r160132 * r160148;
        double r160150 = r160134 * r160140;
        double r160151 = r160138 ? r160149 : r160150;
        double r160152 = r160131 ? r160136 : r160151;
        return r160152;
}

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.7
Herbie6.7
\[\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 < -4.7965124393733665e+73

    1. Initial program 40.1

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

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

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

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

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

    if -4.7965124393733665e+73 < z < 4.946971173738666e+105

    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 *-un-lft-identity10.7

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

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

      \[\leadsto \color{blue}{\left(x \cdot y\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    6. Using strategy rm
    7. Applied associate-*l*9.3

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)}\]
    8. Using strategy rm
    9. Applied div-inv9.4

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

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

    if 4.946971173738666e+105 < z

    1. Initial program 44.5

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019294 
(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.1921305903852764e46) (- (* y x)) (if (< z 5.9762681209208942e90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))

  (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))