Average Error: 24.3 → 6.2
Time: 17.5s
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.58374513121740497 \cdot 10^{153}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \le -1.0822607093553684 \cdot 10^{-157}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \le 1.47125863952031322 \cdot 10^{-158}:\\ \;\;\;\;\frac{y \cdot \left(x \cdot z\right)}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \le 1.89951665536892811 \cdot 10^{151}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\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 -2.58374513121740497 \cdot 10^{153}:\\
\;\;\;\;y \cdot \left(-x\right)\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r290770 = x;
        double r290771 = y;
        double r290772 = r290770 * r290771;
        double r290773 = z;
        double r290774 = r290772 * r290773;
        double r290775 = r290773 * r290773;
        double r290776 = t;
        double r290777 = a;
        double r290778 = r290776 * r290777;
        double r290779 = r290775 - r290778;
        double r290780 = sqrt(r290779);
        double r290781 = r290774 / r290780;
        return r290781;
}

double f(double x, double y, double z, double t, double a) {
        double r290782 = z;
        double r290783 = -2.583745131217405e+153;
        bool r290784 = r290782 <= r290783;
        double r290785 = y;
        double r290786 = x;
        double r290787 = -r290786;
        double r290788 = r290785 * r290787;
        double r290789 = -1.0822607093553684e-157;
        bool r290790 = r290782 <= r290789;
        double r290791 = r290785 * r290786;
        double r290792 = r290782 * r290782;
        double r290793 = t;
        double r290794 = a;
        double r290795 = r290793 * r290794;
        double r290796 = r290792 - r290795;
        double r290797 = sqrt(r290796);
        double r290798 = r290782 / r290797;
        double r290799 = r290791 * r290798;
        double r290800 = 1.4712586395203132e-158;
        bool r290801 = r290782 <= r290800;
        double r290802 = r290786 * r290782;
        double r290803 = r290785 * r290802;
        double r290804 = r290803 / r290797;
        double r290805 = 1.899516655368928e+151;
        bool r290806 = r290782 <= r290805;
        double r290807 = r290786 * r290798;
        double r290808 = r290785 * r290807;
        double r290809 = r290786 * r290785;
        double r290810 = r290806 ? r290808 : r290809;
        double r290811 = r290801 ? r290804 : r290810;
        double r290812 = r290790 ? r290799 : r290811;
        double r290813 = r290784 ? r290788 : r290812;
        return r290813;
}

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.3
Target7.9
Herbie6.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 5 regimes
  2. if z < -2.583745131217405e+153

    1. Initial program 53.9

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

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

      \[\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(y \cdot x\right)} \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\]
    7. Using strategy rm
    8. Applied associate-*l*53.4

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

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

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

    if -2.583745131217405e+153 < z < -1.0822607093553684e-157

    1. Initial program 8.7

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

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

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

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

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

    if -1.0822607093553684e-157 < z < 1.4712586395203132e-158

    1. Initial program 19.2

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity19.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-prod19.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-frac20.5

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

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

      \[\leadsto y \cdot \color{blue}{\frac{x \cdot z}{\sqrt{z \cdot z - t \cdot a}}}\]
    11. Applied associate-*r/18.0

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

    if 1.4712586395203132e-158 < z < 1.899516655368928e+151

    1. Initial program 8.7

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

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

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

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

      \[\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*5.1

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

    if 1.899516655368928e+151 < z

    1. Initial program 53.1

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -2.58374513121740497 \cdot 10^{153}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \le -1.0822607093553684 \cdot 10^{-157}:\\ \;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \le 1.47125863952031322 \cdot 10^{-158}:\\ \;\;\;\;\frac{y \cdot \left(x \cdot z\right)}{\sqrt{z \cdot z - t \cdot a}}\\ \mathbf{elif}\;z \le 1.89951665536892811 \cdot 10^{151}:\\ \;\;\;\;y \cdot \left(x \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019198 +o rules:numerics
(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)))))