Average Error: 23.8 → 5.9
Time: 15.7s
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.8913959868564195 \cdot 10^{+154}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \le 1.1848486164183457 \cdot 10^{+114}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \left(z \cdot \frac{1}{\sqrt{z \cdot z - a \cdot t}}\right)\\ \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 -1.8913959868564195 \cdot 10^{+154}:\\
\;\;\;\;x \cdot \left(-y\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r16898918 = x;
        double r16898919 = y;
        double r16898920 = r16898918 * r16898919;
        double r16898921 = z;
        double r16898922 = r16898920 * r16898921;
        double r16898923 = r16898921 * r16898921;
        double r16898924 = t;
        double r16898925 = a;
        double r16898926 = r16898924 * r16898925;
        double r16898927 = r16898923 - r16898926;
        double r16898928 = sqrt(r16898927);
        double r16898929 = r16898922 / r16898928;
        return r16898929;
}

double f(double x, double y, double z, double t, double a) {
        double r16898930 = z;
        double r16898931 = -1.8913959868564195e+154;
        bool r16898932 = r16898930 <= r16898931;
        double r16898933 = x;
        double r16898934 = y;
        double r16898935 = -r16898934;
        double r16898936 = r16898933 * r16898935;
        double r16898937 = 1.1848486164183457e+114;
        bool r16898938 = r16898930 <= r16898937;
        double r16898939 = r16898934 * r16898933;
        double r16898940 = 1.0;
        double r16898941 = r16898930 * r16898930;
        double r16898942 = a;
        double r16898943 = t;
        double r16898944 = r16898942 * r16898943;
        double r16898945 = r16898941 - r16898944;
        double r16898946 = sqrt(r16898945);
        double r16898947 = r16898940 / r16898946;
        double r16898948 = r16898930 * r16898947;
        double r16898949 = r16898939 * r16898948;
        double r16898950 = r16898938 ? r16898949 : r16898939;
        double r16898951 = r16898932 ? r16898936 : r16898950;
        return r16898951;
}

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.8
Target7.6
Herbie5.9
\[\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.8913959868564195e+154

    1. Initial program 53.3

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

      \[\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-prod53.3

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

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

      \[\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-inv53.4

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

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

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

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

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

    if -1.8913959868564195e+154 < z < 1.1848486164183457e+114

    1. Initial program 10.2

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

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\sqrt{1}} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}}\]
    6. Simplified8.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-inv8.2

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

    if 1.1848486164183457e+114 < z

    1. Initial program 45.5

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -1.8913959868564195 \cdot 10^{+154}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \le 1.1848486164183457 \cdot 10^{+114}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \left(z \cdot \frac{1}{\sqrt{z \cdot z - a \cdot t}}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array}\]

Reproduce

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