Average Error: 7.1 → 0.4
Time: 4.2s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -7.952707828197636571949443580362467231991 \cdot 10^{205}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -1.146408495273293263666975816516032122747 \cdot 10^{-196}:\\ \;\;\;\;\left(t \cdot \left(y \cdot \left(x + z\right)\right)\right) \cdot \frac{y}{\frac{y \cdot \left(x + z\right)}{x - z}}\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 0.0:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 5.196326024148916923916761985956399523298 \cdot 10^{264}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\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 -7.952707828197636571949443580362467231991 \cdot 10^{205}:\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\

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

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

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r429194 = x;
        double r429195 = y;
        double r429196 = r429194 * r429195;
        double r429197 = z;
        double r429198 = r429197 * r429195;
        double r429199 = r429196 - r429198;
        double r429200 = t;
        double r429201 = r429199 * r429200;
        return r429201;
}

double f(double x, double y, double z, double t) {
        double r429202 = x;
        double r429203 = y;
        double r429204 = r429202 * r429203;
        double r429205 = z;
        double r429206 = r429205 * r429203;
        double r429207 = r429204 - r429206;
        double r429208 = -7.952707828197637e+205;
        bool r429209 = r429207 <= r429208;
        double r429210 = r429202 - r429205;
        double r429211 = t;
        double r429212 = r429210 * r429211;
        double r429213 = r429203 * r429212;
        double r429214 = -1.1464084952732933e-196;
        bool r429215 = r429207 <= r429214;
        double r429216 = r429202 + r429205;
        double r429217 = r429203 * r429216;
        double r429218 = r429211 * r429217;
        double r429219 = r429217 / r429210;
        double r429220 = r429203 / r429219;
        double r429221 = r429218 * r429220;
        double r429222 = 0.0;
        bool r429223 = r429207 <= r429222;
        double r429224 = 5.196326024148917e+264;
        bool r429225 = r429207 <= r429224;
        double r429226 = r429207 * r429211;
        double r429227 = r429211 * r429203;
        double r429228 = r429227 * r429210;
        double r429229 = r429225 ? r429226 : r429228;
        double r429230 = r429223 ? r429213 : r429229;
        double r429231 = r429215 ? r429221 : r429230;
        double r429232 = r429209 ? r429213 : r429231;
        return r429232;
}

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.1
Target3.2
Herbie0.4
\[\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 4 regimes
  2. if (- (* x y) (* z y)) < -7.952707828197637e+205 or -1.1464084952732933e-196 < (- (* x y) (* z y)) < 0.0

    1. Initial program 19.1

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

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

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

    if -7.952707828197637e+205 < (- (* x y) (* z y)) < -1.1464084952732933e-196

    1. Initial program 0.3

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied flip--9.7

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

      \[\leadsto \color{blue}{\frac{\left(\left(x \cdot y\right) \cdot \left(x \cdot y\right) - \left(z \cdot y\right) \cdot \left(z \cdot y\right)\right) \cdot t}{x \cdot y + z \cdot y}}\]
    5. Simplified10.9

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

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

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

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

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

    if 0.0 < (- (* x y) (* z y)) < 5.196326024148917e+264

    1. Initial program 1.0

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

    if 5.196326024148917e+264 < (- (* x y) (* z y))

    1. Initial program 46.7

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied flip--64.0

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

      \[\leadsto \color{blue}{\frac{\left(\left(x \cdot y\right) \cdot \left(x \cdot y\right) - \left(z \cdot y\right) \cdot \left(z \cdot y\right)\right) \cdot t}{x \cdot y + z \cdot y}}\]
    5. Simplified62.0

      \[\leadsto \frac{\color{blue}{\left(t \cdot \left(y \cdot \left(x + z\right)\right)\right) \cdot \left(y \cdot \left(x - z\right)\right)}}{x \cdot y + z \cdot y}\]
    6. Taylor expanded around 0 46.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y - z \cdot y \le -7.952707828197636571949443580362467231991 \cdot 10^{205}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le -1.146408495273293263666975816516032122747 \cdot 10^{-196}:\\ \;\;\;\;\left(t \cdot \left(y \cdot \left(x + z\right)\right)\right) \cdot \frac{y}{\frac{y \cdot \left(x + z\right)}{x - z}}\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 0.0:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{elif}\;x \cdot y - z \cdot y \le 5.196326024148916923916761985956399523298 \cdot 10^{264}:\\ \;\;\;\;\left(x \cdot y - z \cdot y\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot y\right) \cdot \left(x - z\right)\\ \end{array}\]

Reproduce

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

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