Average Error: 25.3 → 7.2
Time: 32.6s
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.8045670485597684 \cdot 10^{72}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \le 3.39666918434105311 \cdot 10^{81}:\\ \;\;\;\;x \cdot \frac{y \cdot z}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \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.8045670485597684 \cdot 10^{72}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r187418 = x;
        double r187419 = y;
        double r187420 = r187418 * r187419;
        double r187421 = z;
        double r187422 = r187420 * r187421;
        double r187423 = r187421 * r187421;
        double r187424 = t;
        double r187425 = a;
        double r187426 = r187424 * r187425;
        double r187427 = r187423 - r187426;
        double r187428 = sqrt(r187427);
        double r187429 = r187422 / r187428;
        return r187429;
}

double f(double x, double y, double z, double t, double a) {
        double r187430 = z;
        double r187431 = -2.8045670485597684e+72;
        bool r187432 = r187430 <= r187431;
        double r187433 = x;
        double r187434 = y;
        double r187435 = -r187434;
        double r187436 = r187433 * r187435;
        double r187437 = 3.396669184341053e+81;
        bool r187438 = r187430 <= r187437;
        double r187439 = r187434 * r187430;
        double r187440 = r187430 * r187430;
        double r187441 = t;
        double r187442 = a;
        double r187443 = r187441 * r187442;
        double r187444 = r187440 - r187443;
        double r187445 = sqrt(r187444);
        double r187446 = r187439 / r187445;
        double r187447 = r187433 * r187446;
        double r187448 = r187434 * r187433;
        double r187449 = r187438 ? r187447 : r187448;
        double r187450 = r187432 ? r187436 : r187449;
        return r187450;
}

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.3
Target7.9
Herbie7.2
\[\begin{array}{l} \mathbf{if}\;z \lt -3.1921305903852764 \cdot 10^{46}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;z \lt 5.9762681209208942 \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.8045670485597684e+72

    1. Initial program 41.1

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt41.1

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot \frac{z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity39.6

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

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

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

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

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

      \[\leadsto \frac{x}{\sqrt{\sqrt{1}}} \cdot \color{blue}{\left(-1 \cdot y\right)}\]
    13. Simplified3.8

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

    if -2.8045670485597684e+72 < z < 3.396669184341053e+81

    1. Initial program 11.6

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt11.6

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{\sqrt{\sqrt{1}} \cdot \sqrt{\sqrt{z \cdot z - t \cdot a}}}} \cdot \frac{z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\]
    10. Applied times-frac11.7

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

      \[\leadsto \color{blue}{\frac{x}{\sqrt{\sqrt{1}}} \cdot \left(\frac{y}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot \frac{z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\right)}\]
    12. Using strategy rm
    13. Applied frac-times11.0

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

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

    if 3.396669184341053e+81 < z

    1. Initial program 41.1

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt41.1

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot \frac{z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}}\]
    6. Using strategy rm
    7. Applied associate-*l/39.7

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

      \[\leadsto \color{blue}{x \cdot y}\]
    9. Simplified2.4

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

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

Reproduce

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