Average Error: 6.0 → 0.5
Time: 8.3s
Precision: 64
\[\frac{x \cdot y}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y = -\infty:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;x \cdot y \le -3.303760412052484390435489424481917742401 \cdot 10^{-243} \lor \neg \left(x \cdot y \le 6.866383191027284350312248499135040834178 \cdot 10^{-240}\right) \land x \cdot y \le 8.123647290761479259839095592609619592255 \cdot 10^{143}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]
\frac{x \cdot y}{z}
\begin{array}{l}
\mathbf{if}\;x \cdot y = -\infty:\\
\;\;\;\;x \cdot \frac{y}{z}\\

\mathbf{elif}\;x \cdot y \le -3.303760412052484390435489424481917742401 \cdot 10^{-243} \lor \neg \left(x \cdot y \le 6.866383191027284350312248499135040834178 \cdot 10^{-240}\right) \land x \cdot y \le 8.123647290761479259839095592609619592255 \cdot 10^{143}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\

\end{array}
double f(double x, double y, double z) {
        double r523179 = x;
        double r523180 = y;
        double r523181 = r523179 * r523180;
        double r523182 = z;
        double r523183 = r523181 / r523182;
        return r523183;
}

double f(double x, double y, double z) {
        double r523184 = x;
        double r523185 = y;
        double r523186 = r523184 * r523185;
        double r523187 = -inf.0;
        bool r523188 = r523186 <= r523187;
        double r523189 = z;
        double r523190 = r523185 / r523189;
        double r523191 = r523184 * r523190;
        double r523192 = -3.3037604120524844e-243;
        bool r523193 = r523186 <= r523192;
        double r523194 = 6.866383191027284e-240;
        bool r523195 = r523186 <= r523194;
        double r523196 = !r523195;
        double r523197 = 8.12364729076148e+143;
        bool r523198 = r523186 <= r523197;
        bool r523199 = r523196 && r523198;
        bool r523200 = r523193 || r523199;
        double r523201 = r523186 / r523189;
        double r523202 = r523189 / r523185;
        double r523203 = r523184 / r523202;
        double r523204 = r523200 ? r523201 : r523203;
        double r523205 = r523188 ? r523191 : r523204;
        return r523205;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.0
Target6.0
Herbie0.5
\[\begin{array}{l} \mathbf{if}\;z \lt -4.262230790519428958560619200129306371776 \cdot 10^{-138}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;z \lt 1.704213066065047207696571404603247573308 \cdot 10^{-164}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (* x y) < -inf.0

    1. Initial program 64.0

      \[\frac{x \cdot y}{z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity64.0

      \[\leadsto \frac{x \cdot y}{\color{blue}{1 \cdot z}}\]
    4. Applied times-frac0.2

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{y}{z}}\]
    5. Simplified0.2

      \[\leadsto \color{blue}{x} \cdot \frac{y}{z}\]

    if -inf.0 < (* x y) < -3.3037604120524844e-243 or 6.866383191027284e-240 < (* x y) < 8.12364729076148e+143

    1. Initial program 0.2

      \[\frac{x \cdot y}{z}\]

    if -3.3037604120524844e-243 < (* x y) < 6.866383191027284e-240 or 8.12364729076148e+143 < (* x y)

    1. Initial program 13.8

      \[\frac{x \cdot y}{z}\]
    2. Using strategy rm
    3. Applied associate-/l*0.9

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y = -\infty:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;x \cdot y \le -3.303760412052484390435489424481917742401 \cdot 10^{-243} \lor \neg \left(x \cdot y \le 6.866383191027284350312248499135040834178 \cdot 10^{-240}\right) \land x \cdot y \le 8.123647290761479259839095592609619592255 \cdot 10^{143}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019209 
(FPCore (x y z)
  :name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, A"
  :precision binary64

  :herbie-target
  (if (< z -4.262230790519429e-138) (/ (* x y) z) (if (< z 1.70421306606504721e-164) (/ x (/ z y)) (* (/ x z) y)))

  (/ (* x y) z))