Average Error: 2.1 → 2.1
Time: 16.1s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
x + \left(y - x\right) \cdot \frac{z}{t}
x + \left(y - x\right) \cdot \frac{z}{t}
double f(double x, double y, double z, double t) {
        double r406015 = x;
        double r406016 = y;
        double r406017 = r406016 - r406015;
        double r406018 = z;
        double r406019 = t;
        double r406020 = r406018 / r406019;
        double r406021 = r406017 * r406020;
        double r406022 = r406015 + r406021;
        return r406022;
}

double f(double x, double y, double z, double t) {
        double r406023 = x;
        double r406024 = y;
        double r406025 = r406024 - r406023;
        double r406026 = z;
        double r406027 = t;
        double r406028 = r406026 / r406027;
        double r406029 = r406025 * r406028;
        double r406030 = r406023 + r406029;
        return r406030;
}

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

Original2.1
Target2.3
Herbie2.1
\[\begin{array}{l} \mathbf{if}\;\left(y - x\right) \cdot \frac{z}{t} \lt -1013646692435.88671875:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \mathbf{elif}\;\left(y - x\right) \cdot \frac{z}{t} \lt -0.0:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if t < -8.574909924999468e+31

    1. Initial program 1.0

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

    if -8.574909924999468e+31 < t < 1.5478809779173053e+42

    1. Initial program 3.4

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

      \[\leadsto x + \color{blue}{\left(\left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \sqrt[3]{y - x}\right)} \cdot \frac{z}{t}\]
    4. Applied associate-*l*4.1

      \[\leadsto x + \color{blue}{\left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\sqrt[3]{y - x} \cdot \frac{z}{t}\right)}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt4.3

      \[\leadsto x + \left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\sqrt[3]{y - x} \cdot \frac{z}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}\right)\]
    7. Applied *-un-lft-identity4.3

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

      \[\leadsto x + \left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\sqrt[3]{y - x} \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\right)}\right)\]
    9. Applied associate-*r*3.3

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

      \[\leadsto x + \left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\color{blue}{\frac{\sqrt[3]{y - x}}{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \frac{z}{\sqrt[3]{t}}\right)\]
    11. Using strategy rm
    12. Applied pow13.3

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

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

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

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

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

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

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

      \[\leadsto x + {\color{blue}{\left(\frac{y - x}{\sqrt[3]{t}} \cdot \frac{\frac{z}{\sqrt[3]{t}}}{\sqrt[3]{t}}\right)}}^{1}\]
    20. Taylor expanded around 0 1.6

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

    if 1.5478809779173053e+42 < t

    1. Initial program 1.1

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

      \[\leadsto x + \color{blue}{\left(\left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \sqrt[3]{y - x}\right)} \cdot \frac{z}{t}\]
    4. Applied associate-*l*1.5

      \[\leadsto x + \color{blue}{\left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\sqrt[3]{y - x} \cdot \frac{z}{t}\right)}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt1.6

      \[\leadsto x + \left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\sqrt[3]{y - x} \cdot \frac{z}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}\right)\]
    7. Applied *-un-lft-identity1.6

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

      \[\leadsto x + \left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\sqrt[3]{y - x} \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\right)}\right)\]
    9. Applied associate-*r*1.0

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

      \[\leadsto x + \left(\sqrt[3]{y - x} \cdot \sqrt[3]{y - x}\right) \cdot \left(\color{blue}{\frac{\sqrt[3]{y - x}}{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \frac{z}{\sqrt[3]{t}}\right)\]
    11. Using strategy rm
    12. Applied pow11.0

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

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019291 
(FPCore (x y z t)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"
  :precision binary64

  :herbie-target
  (if (< (* (- y x) (/ z t)) -1013646692435.887) (+ x (/ (- y x) (/ t z))) (if (< (* (- y x) (/ z t)) -0.0) (+ x (/ (* (- y x) z) t)) (+ x (/ (- y x) (/ t z)))))

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