Average Error: 6.5 → 1.5
Time: 12.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 r26362700 = x;
        double r26362701 = y;
        double r26362702 = r26362700 * r26362701;
        double r26362703 = z;
        double r26362704 = r26362703 * r26362701;
        double r26362705 = r26362702 - r26362704;
        double r26362706 = t;
        double r26362707 = r26362705 * r26362706;
        return r26362707;
}

double f(double x, double y, double z, double t) {
        double r26362708 = x;
        double r26362709 = y;
        double r26362710 = r26362708 * r26362709;
        double r26362711 = z;
        double r26362712 = r26362711 * r26362709;
        double r26362713 = r26362710 - r26362712;
        double r26362714 = -4.910837465558025e+303;
        bool r26362715 = r26362713 <= r26362714;
        double r26362716 = 1.0;
        double r26362717 = r26362708 - r26362711;
        double r26362718 = r26362716 / r26362717;
        double r26362719 = t;
        double r26362720 = r26362718 / r26362719;
        double r26362721 = r26362709 / r26362720;
        double r26362722 = 3.08349659668913e+191;
        bool r26362723 = r26362713 <= r26362722;
        double r26362724 = r26362713 * r26362719;
        double r26362725 = r26362719 * r26362717;
        double r26362726 = r26362709 * r26362725;
        double r26362727 = r26362723 ? r26362724 : r26362726;
        double r26362728 = r26362715 ? r26362721 : r26362727;
        return r26362728;
}

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))