Average Error: 25.1 → 7.8
Time: 13.4s
Precision: 64
\[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
\[\begin{array}{l} \mathbf{if}\;z \le -440484499953959918458009527457306384531500:\\ \;\;\;\;\frac{x}{1} \cdot \left(-1 \cdot y\right)\\ \mathbf{elif}\;z \le 1.477826628139674547459276446730265213535 \cdot 10^{58}:\\ \;\;\;\;\frac{\frac{x \cdot y}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot z}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{1} \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 -440484499953959918458009527457306384531500:\\
\;\;\;\;\frac{x}{1} \cdot \left(-1 \cdot y\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r174781 = x;
        double r174782 = y;
        double r174783 = r174781 * r174782;
        double r174784 = z;
        double r174785 = r174783 * r174784;
        double r174786 = r174784 * r174784;
        double r174787 = t;
        double r174788 = a;
        double r174789 = r174787 * r174788;
        double r174790 = r174786 - r174789;
        double r174791 = sqrt(r174790);
        double r174792 = r174785 / r174791;
        return r174792;
}

double f(double x, double y, double z, double t, double a) {
        double r174793 = z;
        double r174794 = -4.404844999539599e+41;
        bool r174795 = r174793 <= r174794;
        double r174796 = x;
        double r174797 = 1.0;
        double r174798 = r174796 / r174797;
        double r174799 = -1.0;
        double r174800 = y;
        double r174801 = r174799 * r174800;
        double r174802 = r174798 * r174801;
        double r174803 = 1.4778266281396745e+58;
        bool r174804 = r174793 <= r174803;
        double r174805 = r174796 * r174800;
        double r174806 = r174793 * r174793;
        double r174807 = t;
        double r174808 = a;
        double r174809 = r174807 * r174808;
        double r174810 = r174806 - r174809;
        double r174811 = sqrt(r174810);
        double r174812 = sqrt(r174811);
        double r174813 = r174805 / r174812;
        double r174814 = r174813 * r174793;
        double r174815 = r174814 / r174812;
        double r174816 = r174798 * r174800;
        double r174817 = r174804 ? r174815 : r174816;
        double r174818 = r174795 ? r174802 : r174817;
        return r174818;
}

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.1
Target8.1
Herbie7.8
\[\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 < -4.404844999539599e+41

    1. Initial program 37.4

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{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)}\]
    10. Taylor expanded around -inf 4.4

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

    if -4.404844999539599e+41 < z < 1.4778266281396745e+58

    1. Initial program 12.1

      \[\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt12.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-prod12.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-frac11.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 associate-*r/11.9

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

    if 1.4778266281396745e+58 < z

    1. Initial program 38.5

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{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)}\]
    10. Taylor expanded around inf 3.1

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

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

Reproduce

herbie shell --seed 2019291 
(FPCore (x y z t a)
  :name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (if (< z -3.1921305903852764e46) (- (* y x)) (if (< z 5.9762681209208942e90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))

  (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))