Average Error: 24.8 → 6.4
Time: 6.3s
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.068598920199789518598282705570987537021 \cdot 10^{144}:\\ \;\;\;\;-1 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \le 1.584842902493884824536728315524484983777 \cdot 10^{121}:\\ \;\;\;\;\frac{x \cdot y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\ \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.068598920199789518598282705570987537021 \cdot 10^{144}:\\
\;\;\;\;-1 \cdot \left(x \cdot y\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r295439 = x;
        double r295440 = y;
        double r295441 = r295439 * r295440;
        double r295442 = z;
        double r295443 = r295441 * r295442;
        double r295444 = r295442 * r295442;
        double r295445 = t;
        double r295446 = a;
        double r295447 = r295445 * r295446;
        double r295448 = r295444 - r295447;
        double r295449 = sqrt(r295448);
        double r295450 = r295443 / r295449;
        return r295450;
}

double f(double x, double y, double z, double t, double a) {
        double r295451 = z;
        double r295452 = -1.0685989201997895e+144;
        bool r295453 = r295451 <= r295452;
        double r295454 = -1.0;
        double r295455 = x;
        double r295456 = y;
        double r295457 = r295455 * r295456;
        double r295458 = r295454 * r295457;
        double r295459 = 1.5848429024938848e+121;
        bool r295460 = r295451 <= r295459;
        double r295461 = r295451 * r295451;
        double r295462 = t;
        double r295463 = a;
        double r295464 = r295462 * r295463;
        double r295465 = r295461 - r295464;
        double r295466 = sqrt(r295465);
        double r295467 = r295466 / r295451;
        double r295468 = r295457 / r295467;
        double r295469 = r295460 ? r295468 : r295457;
        double r295470 = r295453 ? r295458 : r295469;
        return r295470;
}

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.8
Target7.6
Herbie6.4
\[\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 < -1.0685989201997895e+144

    1. Initial program 51.3

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

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

    if -1.0685989201997895e+144 < z < 1.5848429024938848e+121

    1. Initial program 11.2

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

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

    if 1.5848429024938848e+121 < z

    1. Initial program 48.0

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

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

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

Reproduce

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