Average Error: 6.5 → 1.5
Time: 11.9s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -4.910837465558025 \cdot 10^{+303}:\\ \;\;\;\;\frac{y}{\frac{\frac{1}{x - z}}{t}}\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 3.08349659668913 \cdot 10^{+191}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;x \cdot y - z \cdot y \le -4.910837465558025 \cdot 10^{+303}:\\
\;\;\;\;\frac{y}{\frac{\frac{1}{x - z}}{t}}\\

\mathbf{elif}\;x \cdot y - z \cdot y \le 3.08349659668913 \cdot 10^{+191}:\\
\;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r28775612 = x;
        double r28775613 = y;
        double r28775614 = r28775612 * r28775613;
        double r28775615 = z;
        double r28775616 = r28775615 * r28775613;
        double r28775617 = r28775614 - r28775616;
        double r28775618 = t;
        double r28775619 = r28775617 * r28775618;
        return r28775619;
}

double f(double x, double y, double z, double t) {
        double r28775620 = x;
        double r28775621 = y;
        double r28775622 = r28775620 * r28775621;
        double r28775623 = z;
        double r28775624 = r28775623 * r28775621;
        double r28775625 = r28775622 - r28775624;
        double r28775626 = -4.910837465558025e+303;
        bool r28775627 = r28775625 <= r28775626;
        double r28775628 = 1.0;
        double r28775629 = r28775620 - r28775623;
        double r28775630 = r28775628 / r28775629;
        double r28775631 = t;
        double r28775632 = r28775630 / r28775631;
        double r28775633 = r28775621 / r28775632;
        double r28775634 = 3.08349659668913e+191;
        bool r28775635 = r28775625 <= r28775634;
        double r28775636 = r28775625 * r28775631;
        double r28775637 = r28775631 * r28775629;
        double r28775638 = r28775621 * r28775637;
        double r28775639 = r28775635 ? r28775636 : r28775638;
        double r28775640 = r28775627 ? r28775633 : r28775639;
        return r28775640;
}

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.5
Target3.0
Herbie1.5
\[\begin{array}{l} \mathbf{if}\;t \lt -9.231879582886777 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.543067051564877 \cdot 10^{+83}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (- (* x y) (* z y)) < -4.910837465558025e+303

    1. Initial program 56.8

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied distribute-rgt-out--56.8

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

      \[\leadsto \color{blue}{y \cdot \left(\left(x - z\right) \cdot t\right)}\]
    5. Using strategy rm
    6. Applied flip--45.0

      \[\leadsto y \cdot \left(\color{blue}{\frac{x \cdot x - z \cdot z}{x + z}} \cdot t\right)\]
    7. Applied associate-*l/45.0

      \[\leadsto y \cdot \color{blue}{\frac{\left(x \cdot x - z \cdot z\right) \cdot t}{x + z}}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity45.0

      \[\leadsto \color{blue}{\left(1 \cdot y\right)} \cdot \frac{\left(x \cdot x - z \cdot z\right) \cdot t}{x + z}\]
    10. Applied associate-*l*45.0

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

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

    if -4.910837465558025e+303 < (- (* x y) (* z y)) < 3.08349659668913e+191

    1. Initial program 1.6

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]

    if 3.08349659668913e+191 < (- (* x y) (* z y))

    1. Initial program 26.1

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied distribute-rgt-out--26.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -4.910837465558025 \cdot 10^{+303}:\\ \;\;\;\;\frac{y}{\frac{\frac{1}{x - z}}{t}}\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 3.08349659668913 \cdot 10^{+191}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019162 
(FPCore (x y z t)
  :name "Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3"

  :herbie-target
  (if (< t -9.231879582886777e-80) (* (* y t) (- x z)) (if (< t 2.543067051564877e+83) (* y (* t (- x z))) (* (* y (- x z)) t)))

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