Average Error: 23.9 → 6.3
Time: 30.0s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -1.510233764806379 \cdot 10^{+78}:\\ \;\;\;\;\frac{x \cdot y}{\frac{a}{\frac{z \cdot z}{t}} \cdot \frac{1}{2} + -1}\\ \mathbf{elif}\;z \le 2.574280554580049 \cdot 10^{+79}:\\ \;\;\;\;\left(z \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right) \cdot \left(x \cdot y\right)\\ \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 -1.510233764806379 \cdot 10^{+78}:\\
\;\;\;\;\frac{x \cdot y}{\frac{a}{\frac{z \cdot z}{t}} \cdot \frac{1}{2} + -1}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r28181658 = x;
        double r28181659 = y;
        double r28181660 = r28181658 * r28181659;
        double r28181661 = z;
        double r28181662 = r28181660 * r28181661;
        double r28181663 = r28181661 * r28181661;
        double r28181664 = t;
        double r28181665 = a;
        double r28181666 = r28181664 * r28181665;
        double r28181667 = r28181663 - r28181666;
        double r28181668 = sqrt(r28181667);
        double r28181669 = r28181662 / r28181668;
        return r28181669;
}

double f(double x, double y, double z, double t, double a) {
        double r28181670 = z;
        double r28181671 = -1.510233764806379e+78;
        bool r28181672 = r28181670 <= r28181671;
        double r28181673 = x;
        double r28181674 = y;
        double r28181675 = r28181673 * r28181674;
        double r28181676 = a;
        double r28181677 = r28181670 * r28181670;
        double r28181678 = t;
        double r28181679 = r28181677 / r28181678;
        double r28181680 = r28181676 / r28181679;
        double r28181681 = 0.5;
        double r28181682 = r28181680 * r28181681;
        double r28181683 = -1.0;
        double r28181684 = r28181682 + r28181683;
        double r28181685 = r28181675 / r28181684;
        double r28181686 = 2.574280554580049e+79;
        bool r28181687 = r28181670 <= r28181686;
        double r28181688 = 1.0;
        double r28181689 = r28181678 * r28181676;
        double r28181690 = r28181677 - r28181689;
        double r28181691 = sqrt(r28181690);
        double r28181692 = r28181688 / r28181691;
        double r28181693 = r28181670 * r28181692;
        double r28181694 = r28181693 * r28181675;
        double r28181695 = r28181687 ? r28181694 : r28181675;
        double r28181696 = r28181672 ? r28181685 : r28181695;
        return r28181696;
}

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

Original23.9
Target7.5
Herbie6.3
\[\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 < -1.510233764806379e+78

    1. Initial program 39.1

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

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

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

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

    if -1.510233764806379e+78 < z < 2.574280554580049e+79

    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.2

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

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

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

    if 2.574280554580049e+79 < z

    1. Initial program 40.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.510233764806379 \cdot 10^{+78}:\\ \;\;\;\;\frac{x \cdot y}{\frac{a}{\frac{z \cdot z}{t}} \cdot \frac{1}{2} + -1}\\ \mathbf{elif}\;z \le 2.574280554580049 \cdot 10^{+79}:\\ \;\;\;\;\left(z \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\right) \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

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