Average Error: 3.5 → 1.0
Time: 9.3s
Precision: 64
\[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.23853620324777987 \cdot 10^{141}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{3} \cdot \frac{\frac{1}{y}}{z}\\ \mathbf{elif}\;t \le 8.57969581197539482 \cdot 10^{48}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}\\ \mathbf{else}:\\ \;\;\;\;\left(x - \frac{\frac{y}{z}}{3}\right) + 1 \cdot \frac{\frac{t}{z \cdot y}}{3}\\ \end{array}\]
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\begin{array}{l}
\mathbf{if}\;t \le -1.23853620324777987 \cdot 10^{141}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{3} \cdot \frac{\frac{1}{y}}{z}\\

\mathbf{elif}\;t \le 8.57969581197539482 \cdot 10^{48}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}\\

\mathbf{else}:\\
\;\;\;\;\left(x - \frac{\frac{y}{z}}{3}\right) + 1 \cdot \frac{\frac{t}{z \cdot y}}{3}\\

\end{array}
double f(double x, double y, double z, double t) {
        double r4348 = x;
        double r4349 = y;
        double r4350 = z;
        double r4351 = 3.0;
        double r4352 = r4350 * r4351;
        double r4353 = r4349 / r4352;
        double r4354 = r4348 - r4353;
        double r4355 = t;
        double r4356 = r4352 * r4349;
        double r4357 = r4355 / r4356;
        double r4358 = r4354 + r4357;
        return r4358;
}

double f(double x, double y, double z, double t) {
        double r4359 = t;
        double r4360 = -1.2385362032477799e+141;
        bool r4361 = r4359 <= r4360;
        double r4362 = x;
        double r4363 = y;
        double r4364 = z;
        double r4365 = 3.0;
        double r4366 = r4364 * r4365;
        double r4367 = r4363 / r4366;
        double r4368 = r4362 - r4367;
        double r4369 = r4359 / r4365;
        double r4370 = 1.0;
        double r4371 = r4370 / r4363;
        double r4372 = r4371 / r4364;
        double r4373 = r4369 * r4372;
        double r4374 = r4368 + r4373;
        double r4375 = 8.579695811975395e+48;
        bool r4376 = r4359 <= r4375;
        double r4377 = r4359 / r4366;
        double r4378 = r4377 / r4363;
        double r4379 = r4368 + r4378;
        double r4380 = r4363 / r4364;
        double r4381 = r4380 / r4365;
        double r4382 = r4362 - r4381;
        double r4383 = r4364 * r4363;
        double r4384 = r4359 / r4383;
        double r4385 = r4384 / r4365;
        double r4386 = r4370 * r4385;
        double r4387 = r4382 + r4386;
        double r4388 = r4376 ? r4379 : r4387;
        double r4389 = r4361 ? r4374 : r4388;
        return r4389;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original3.5
Target1.9
Herbie1.0
\[\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}\]

Derivation

  1. Split input into 3 regimes
  2. if t < -1.2385362032477799e+141

    1. Initial program 1.1

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\]
    2. Using strategy rm
    3. Applied pow11.1

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot \color{blue}{{y}^{1}}}\]
    4. Applied pow11.1

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot \color{blue}{{3}^{1}}\right) \cdot {y}^{1}}\]
    5. Applied pow11.1

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

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{{\left(z \cdot 3\right)}^{1}} \cdot {y}^{1}}\]
    7. Applied pow-prod-down1.1

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{{\left(\left(z \cdot 3\right) \cdot y\right)}^{1}}}\]
    8. Simplified1.0

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{{\color{blue}{\left(3 \cdot \left(z \cdot y\right)\right)}}^{1}}\]
    9. Using strategy rm
    10. Applied clear-num1.1

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{1}{\frac{{\left(3 \cdot \left(z \cdot y\right)\right)}^{1}}{t}}}\]
    11. Simplified1.0

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\color{blue}{\frac{3}{\frac{t}{z \cdot y}}}}\]
    12. Using strategy rm
    13. Applied associate-/r/1.1

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\color{blue}{\frac{3}{t} \cdot \left(z \cdot y\right)}}\]
    14. Applied add-cube-cbrt1.1

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\frac{3}{t} \cdot \left(z \cdot y\right)}\]
    15. Applied times-frac1.1

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{3}{t}} \cdot \frac{\sqrt[3]{1}}{z \cdot y}}\]
    16. Simplified1.0

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{t}{3}} \cdot \frac{\sqrt[3]{1}}{z \cdot y}\]
    17. Simplified1.0

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

    if -1.2385362032477799e+141 < t < 8.579695811975395e+48

    1. Initial program 4.6

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\]
    2. Using strategy rm
    3. Applied associate-/r*1.0

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

    if 8.579695811975395e+48 < t

    1. Initial program 0.6

      \[\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\]
    2. Using strategy rm
    3. Applied pow10.6

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot \color{blue}{{y}^{1}}}\]
    4. Applied pow10.6

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot \color{blue}{{3}^{1}}\right) \cdot {y}^{1}}\]
    5. Applied pow10.6

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

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

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\color{blue}{{\left(\left(z \cdot 3\right) \cdot y\right)}^{1}}}\]
    8. Simplified0.6

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{{\color{blue}{\left(3 \cdot \left(z \cdot y\right)\right)}}^{1}}\]
    9. Using strategy rm
    10. Applied clear-num0.6

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{1}{\frac{{\left(3 \cdot \left(z \cdot y\right)\right)}^{1}}{t}}}\]
    11. Simplified0.8

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\color{blue}{\frac{3}{\frac{t}{z \cdot y}}}}\]
    12. Using strategy rm
    13. Applied *-un-lft-identity0.8

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\frac{3}{\color{blue}{1 \cdot \frac{t}{z \cdot y}}}}\]
    14. Applied *-un-lft-identity0.8

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\frac{\color{blue}{1 \cdot 3}}{1 \cdot \frac{t}{z \cdot y}}}\]
    15. Applied times-frac0.8

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{1}{\color{blue}{\frac{1}{1} \cdot \frac{3}{\frac{t}{z \cdot y}}}}\]
    16. Applied add-cube-cbrt0.8

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\frac{1}{1} \cdot \frac{3}{\frac{t}{z \cdot y}}}\]
    17. Applied times-frac0.8

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{1}{1}} \cdot \frac{\sqrt[3]{1}}{\frac{3}{\frac{t}{z \cdot y}}}}\]
    18. Simplified0.8

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + \color{blue}{1} \cdot \frac{\sqrt[3]{1}}{\frac{3}{\frac{t}{z \cdot y}}}\]
    19. Simplified0.7

      \[\leadsto \left(x - \frac{y}{z \cdot 3}\right) + 1 \cdot \color{blue}{\frac{\frac{t}{z \cdot y}}{3}}\]
    20. Using strategy rm
    21. Applied associate-/r*0.8

      \[\leadsto \left(x - \color{blue}{\frac{\frac{y}{z}}{3}}\right) + 1 \cdot \frac{\frac{t}{z \cdot y}}{3}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.23853620324777987 \cdot 10^{141}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{3} \cdot \frac{\frac{1}{y}}{z}\\ \mathbf{elif}\;t \le 8.57969581197539482 \cdot 10^{48}:\\ \;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}\\ \mathbf{else}:\\ \;\;\;\;\left(x - \frac{\frac{y}{z}}{3}\right) + 1 \cdot \frac{\frac{t}{z \cdot y}}{3}\\ \end{array}\]

Reproduce

herbie shell --seed 2020025 +o rules:numerics
(FPCore (x y z t)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, H"
  :precision binary64

  :herbie-target
  (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y))

  (+ (- x (/ y (* z 3))) (/ t (* (* z 3) y))))