Average Error: 6.3 → 0.5
Time: 35.8s
Precision: 64
\[\frac{x \cdot y}{z}\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y = -\infty:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;x \cdot y \le -2.194443350775470398848039528862924587498 \cdot 10^{-140}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;x \cdot y \le 1.132971827104085719715227384294432498361 \cdot 10^{-277}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;x \cdot y \le 4.552391931798920032050045519550199226521 \cdot 10^{228}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array}\]
\frac{x \cdot y}{z}
\begin{array}{l}
\mathbf{if}\;x \cdot y = -\infty:\\
\;\;\;\;\frac{x}{z} \cdot y\\

\mathbf{elif}\;x \cdot y \le -2.194443350775470398848039528862924587498 \cdot 10^{-140}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

\mathbf{elif}\;x \cdot y \le 1.132971827104085719715227384294432498361 \cdot 10^{-277}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\

\mathbf{elif}\;x \cdot y \le 4.552391931798920032050045519550199226521 \cdot 10^{228}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

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

\end{array}
double f(double x, double y, double z) {
        double r640277 = x;
        double r640278 = y;
        double r640279 = r640277 * r640278;
        double r640280 = z;
        double r640281 = r640279 / r640280;
        return r640281;
}

double f(double x, double y, double z) {
        double r640282 = x;
        double r640283 = y;
        double r640284 = r640282 * r640283;
        double r640285 = -inf.0;
        bool r640286 = r640284 <= r640285;
        double r640287 = z;
        double r640288 = r640282 / r640287;
        double r640289 = r640288 * r640283;
        double r640290 = -2.1944433507754704e-140;
        bool r640291 = r640284 <= r640290;
        double r640292 = r640284 / r640287;
        double r640293 = 1.1329718271040857e-277;
        bool r640294 = r640284 <= r640293;
        double r640295 = r640287 / r640282;
        double r640296 = r640283 / r640295;
        double r640297 = 4.55239193179892e+228;
        bool r640298 = r640284 <= r640297;
        double r640299 = r640298 ? r640292 : r640289;
        double r640300 = r640294 ? r640296 : r640299;
        double r640301 = r640291 ? r640292 : r640300;
        double r640302 = r640286 ? r640289 : r640301;
        return r640302;
}

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.3
Target6.4
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 or 4.55239193179892e+228 < (* x y)

    1. Initial program 44.3

      \[\frac{x \cdot y}{z}\]
    2. Simplified0.5

      \[\leadsto \color{blue}{\frac{y}{z} \cdot x}\]
    3. Using strategy rm
    4. Applied pow10.5

      \[\leadsto \frac{y}{z} \cdot \color{blue}{{x}^{1}}\]
    5. Applied pow10.5

      \[\leadsto \color{blue}{{\left(\frac{y}{z}\right)}^{1}} \cdot {x}^{1}\]
    6. Applied pow-prod-down0.5

      \[\leadsto \color{blue}{{\left(\frac{y}{z} \cdot x\right)}^{1}}\]
    7. Simplified0.6

      \[\leadsto {\color{blue}{\left(\frac{y}{\frac{z}{x}}\right)}}^{1}\]
    8. Taylor expanded around 0 44.3

      \[\leadsto {\color{blue}{\left(\frac{x \cdot y}{z}\right)}}^{1}\]
    9. Simplified0.6

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

    if -inf.0 < (* x y) < -2.1944433507754704e-140 or 1.1329718271040857e-277 < (* x y) < 4.55239193179892e+228

    1. Initial program 0.2

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

    if -2.1944433507754704e-140 < (* x y) < 1.1329718271040857e-277

    1. Initial program 11.1

      \[\frac{x \cdot y}{z}\]
    2. Simplified0.9

      \[\leadsto \color{blue}{\frac{y}{z} \cdot x}\]
    3. Using strategy rm
    4. Applied pow10.9

      \[\leadsto \frac{y}{z} \cdot \color{blue}{{x}^{1}}\]
    5. Applied pow10.9

      \[\leadsto \color{blue}{{\left(\frac{y}{z}\right)}^{1}} \cdot {x}^{1}\]
    6. Applied pow-prod-down0.9

      \[\leadsto \color{blue}{{\left(\frac{y}{z} \cdot x\right)}^{1}}\]
    7. Simplified1.0

      \[\leadsto {\color{blue}{\left(\frac{y}{\frac{z}{x}}\right)}}^{1}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y = -\infty:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;x \cdot y \le -2.194443350775470398848039528862924587498 \cdot 10^{-140}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;x \cdot y \le 1.132971827104085719715227384294432498361 \cdot 10^{-277}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;x \cdot y \le 4.552391931798920032050045519550199226521 \cdot 10^{228}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array}\]

Reproduce

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

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

  (/ (* x y) z))