Average Error: 7.0 → 2.5
Time: 13.2s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -2.164959082202829261262267562936587814033 \cdot 10^{46}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{elif}\;t \le 9.353967203451809527016106455487665678901 \cdot 10^{-36}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -2.164959082202829261262267562936587814033 \cdot 10^{46}:\\
\;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r701086 = x;
        double r701087 = y;
        double r701088 = r701086 * r701087;
        double r701089 = z;
        double r701090 = r701089 * r701087;
        double r701091 = r701088 - r701090;
        double r701092 = t;
        double r701093 = r701091 * r701092;
        return r701093;
}

double f(double x, double y, double z, double t) {
        double r701094 = t;
        double r701095 = -2.1649590822028293e+46;
        bool r701096 = r701094 <= r701095;
        double r701097 = y;
        double r701098 = x;
        double r701099 = z;
        double r701100 = r701098 - r701099;
        double r701101 = r701097 * r701100;
        double r701102 = r701101 * r701094;
        double r701103 = 9.35396720345181e-36;
        bool r701104 = r701094 <= r701103;
        double r701105 = r701094 * r701100;
        double r701106 = r701097 * r701105;
        double r701107 = r701097 * r701094;
        double r701108 = r701107 * r701100;
        double r701109 = r701104 ? r701106 : r701108;
        double r701110 = r701096 ? r701102 : r701109;
        return r701110;
}

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

Original7.0
Target3.2
Herbie2.5
\[\begin{array}{l} \mathbf{if}\;t \lt -9.231879582886776938073886590448747944753 \cdot 10^{-80}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \mathbf{elif}\;t \lt 2.543067051564877116200336808272775217995 \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 t < -2.1649590822028293e+46

    1. Initial program 3.6

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

      \[\leadsto \color{blue}{\left(x - z\right) \cdot \left(t \cdot y\right)}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt6.2

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

      \[\leadsto \color{blue}{\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot \left(\sqrt[3]{x - z} \cdot \left(t \cdot y\right)\right)}\]
    6. Taylor expanded around inf 3.6

      \[\leadsto \color{blue}{t \cdot \left(x \cdot y\right) - t \cdot \left(z \cdot y\right)}\]
    7. Simplified3.6

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

    if -2.1649590822028293e+46 < t < 9.35396720345181e-36

    1. Initial program 9.3

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified8.6

      \[\leadsto \color{blue}{\left(x - z\right) \cdot \left(t \cdot y\right)}\]
    3. Using strategy rm
    4. Applied associate-*r*2.1

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

    if 9.35396720345181e-36 < t

    1. Initial program 2.9

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Simplified2.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.164959082202829261262267562936587814033 \cdot 10^{46}:\\ \;\;\;\;\left(y \cdot \left(x - z\right)\right) \cdot t\\ \mathbf{elif}\;t \le 9.353967203451809527016106455487665678901 \cdot 10^{-36}:\\ \;\;\;\;y \cdot \left(t \cdot \left(x - z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019174 
(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))