Average Error: 6.6 → 6.6
Time: 5.0s
Precision: 64
\[x + \frac{\left(y - x\right) \cdot z}{t}\]
\[\frac{y \cdot z}{t} + \left(x - \frac{x \cdot z}{t}\right)\]
x + \frac{\left(y - x\right) \cdot z}{t}
\frac{y \cdot z}{t} + \left(x - \frac{x \cdot z}{t}\right)
double f(double x, double y, double z, double t) {
        double r340685 = x;
        double r340686 = y;
        double r340687 = r340686 - r340685;
        double r340688 = z;
        double r340689 = r340687 * r340688;
        double r340690 = t;
        double r340691 = r340689 / r340690;
        double r340692 = r340685 + r340691;
        return r340692;
}

double f(double x, double y, double z, double t) {
        double r340693 = y;
        double r340694 = z;
        double r340695 = r340693 * r340694;
        double r340696 = t;
        double r340697 = r340695 / r340696;
        double r340698 = x;
        double r340699 = r340698 * r340694;
        double r340700 = r340699 / r340696;
        double r340701 = r340698 - r340700;
        double r340702 = r340697 + r340701;
        return r340702;
}

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

Original6.6
Target2.1
Herbie6.6
\[\begin{array}{l} \mathbf{if}\;x \lt -9.025511195533004570453352523209034680317 \cdot 10^{-135}:\\ \;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\ \mathbf{elif}\;x \lt 4.275032163700714748507147332551979944314 \cdot 10^{-250}:\\ \;\;\;\;x + \frac{y - x}{t} \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \end{array}\]

Derivation

  1. Initial program 6.6

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

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

    \[\leadsto x + \color{blue}{\frac{y - x}{1} \cdot \frac{z}{t}}\]
  5. Simplified2.0

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

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

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

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

    \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \frac{\sqrt[3]{z} \cdot \sqrt[3]{z}}{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right) \cdot \frac{\sqrt[3]{z}}{\sqrt[3]{t}}}\]
  11. Final simplification6.6

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

Reproduce

herbie shell --seed 1978988140 
(FPCore (x y z t)
  :name "Numeric.Histogram:binBounds from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (if (< x -9.0255111955330046e-135) (- x (* (/ z t) (- x y))) (if (< x 4.2750321637007147e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))

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