Average Error: 25.2 → 6.0
Time: 49.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 -2.690113287998358735369304070753702209116 \cdot 10^{113}:\\ \;\;\;\;\left(-y\right) \cdot x\\ \mathbf{elif}\;z \le 2.683505290623298327082591984564545000856 \cdot 10^{137}:\\ \;\;\;\;\frac{y}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}} \cdot x\\ \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 -2.690113287998358735369304070753702209116 \cdot 10^{113}:\\
\;\;\;\;\left(-y\right) \cdot x\\

\mathbf{elif}\;z \le 2.683505290623298327082591984564545000856 \cdot 10^{137}:\\
\;\;\;\;\frac{y}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}} \cdot x\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r17049140 = x;
        double r17049141 = y;
        double r17049142 = r17049140 * r17049141;
        double r17049143 = z;
        double r17049144 = r17049142 * r17049143;
        double r17049145 = r17049143 * r17049143;
        double r17049146 = t;
        double r17049147 = a;
        double r17049148 = r17049146 * r17049147;
        double r17049149 = r17049145 - r17049148;
        double r17049150 = sqrt(r17049149);
        double r17049151 = r17049144 / r17049150;
        return r17049151;
}

double f(double x, double y, double z, double t, double a) {
        double r17049152 = z;
        double r17049153 = -2.6901132879983587e+113;
        bool r17049154 = r17049152 <= r17049153;
        double r17049155 = y;
        double r17049156 = -r17049155;
        double r17049157 = x;
        double r17049158 = r17049156 * r17049157;
        double r17049159 = 2.6835052906232983e+137;
        bool r17049160 = r17049152 <= r17049159;
        double r17049161 = r17049152 * r17049152;
        double r17049162 = a;
        double r17049163 = t;
        double r17049164 = r17049162 * r17049163;
        double r17049165 = r17049161 - r17049164;
        double r17049166 = sqrt(r17049165);
        double r17049167 = r17049166 / r17049152;
        double r17049168 = r17049155 / r17049167;
        double r17049169 = r17049168 * r17049157;
        double r17049170 = r17049157 * r17049155;
        double r17049171 = r17049160 ? r17049169 : r17049170;
        double r17049172 = r17049154 ? r17049158 : r17049171;
        return r17049172;
}

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.2
Target7.7
Herbie6.0
\[\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 < -2.6901132879983587e+113

    1. Initial program 46.3

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

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

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

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

    if -2.6901132879983587e+113 < z < 2.6835052906232983e+137

    1. Initial program 11.0

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

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

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

      \[\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-prod9.2

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

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

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

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

    if 2.6835052906232983e+137 < z

    1. Initial program 50.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -2.690113287998358735369304070753702209116 \cdot 10^{113}:\\ \;\;\;\;\left(-y\right) \cdot x\\ \mathbf{elif}\;z \le 2.683505290623298327082591984564545000856 \cdot 10^{137}:\\ \;\;\;\;\frac{y}{\frac{\sqrt{z \cdot z - a \cdot t}}{z}} \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

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