Average Error: 24.9 → 7.7
Time: 18.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 -2.885407554804660517455724314669671165557 \cdot 10^{71}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \le 5.930939844067445722258493130712277239397 \cdot 10^{90}:\\ \;\;\;\;\frac{x \cdot \left(y \cdot z\right)}{\sqrt{z \cdot z - a \cdot t}}\\ \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.885407554804660517455724314669671165557 \cdot 10^{71}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r19982260 = x;
        double r19982261 = y;
        double r19982262 = r19982260 * r19982261;
        double r19982263 = z;
        double r19982264 = r19982262 * r19982263;
        double r19982265 = r19982263 * r19982263;
        double r19982266 = t;
        double r19982267 = a;
        double r19982268 = r19982266 * r19982267;
        double r19982269 = r19982265 - r19982268;
        double r19982270 = sqrt(r19982269);
        double r19982271 = r19982264 / r19982270;
        return r19982271;
}

double f(double x, double y, double z, double t, double a) {
        double r19982272 = z;
        double r19982273 = -2.8854075548046605e+71;
        bool r19982274 = r19982272 <= r19982273;
        double r19982275 = x;
        double r19982276 = y;
        double r19982277 = -r19982276;
        double r19982278 = r19982275 * r19982277;
        double r19982279 = 5.930939844067446e+90;
        bool r19982280 = r19982272 <= r19982279;
        double r19982281 = r19982276 * r19982272;
        double r19982282 = r19982275 * r19982281;
        double r19982283 = r19982272 * r19982272;
        double r19982284 = a;
        double r19982285 = t;
        double r19982286 = r19982284 * r19982285;
        double r19982287 = r19982283 - r19982286;
        double r19982288 = sqrt(r19982287);
        double r19982289 = r19982282 / r19982288;
        double r19982290 = r19982275 * r19982276;
        double r19982291 = r19982280 ? r19982289 : r19982290;
        double r19982292 = r19982274 ? r19982278 : r19982291;
        return r19982292;
}

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.9
Target7.9
Herbie7.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 < -2.8854075548046605e+71

    1. Initial program 39.6

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

      \[\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-prod39.6

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

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

      \[\leadsto \color{blue}{\left(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Using strategy rm
    8. Applied add-sqr-sqrt36.6

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

      \[\leadsto \left(y \cdot x\right) \cdot \frac{z}{\color{blue}{\sqrt{\sqrt{z \cdot z - t \cdot a}} \cdot \sqrt{\sqrt{z \cdot z - t \cdot a}}}}\]
    10. Applied *-un-lft-identity36.7

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

      \[\leadsto \left(y \cdot x\right) \cdot \color{blue}{\left(\frac{1}{\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.3

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

      \[\leadsto \color{blue}{-x \cdot y}\]

    if -2.8854075548046605e+71 < z < 5.930939844067446e+90

    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*11.8

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

    if 5.930939844067446e+90 < z

    1. Initial program 43.0

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

      \[\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-prod43.0

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

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

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

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

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

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

Reproduce

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