Average Error: 7.2 → 7.1
Time: 4.2s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\left(t \cdot y\right) \cdot \left(x - z\right)\]
\left(x \cdot y - z \cdot y\right) \cdot t
\left(t \cdot y\right) \cdot \left(x - z\right)
double f(double x, double y, double z, double t) {
        double r398314 = x;
        double r398315 = y;
        double r398316 = r398314 * r398315;
        double r398317 = z;
        double r398318 = r398317 * r398315;
        double r398319 = r398316 - r398318;
        double r398320 = t;
        double r398321 = r398319 * r398320;
        return r398321;
}

double f(double x, double y, double z, double t) {
        double r398322 = t;
        double r398323 = y;
        double r398324 = r398322 * r398323;
        double r398325 = x;
        double r398326 = z;
        double r398327 = r398325 - r398326;
        double r398328 = r398324 * r398327;
        return r398328;
}

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.2
Target3.1
Herbie7.1
\[\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 (- (* x y) (* z y)) < -1.7752227888120415e+293 or 3.1698261024189057e+198 < (- (* x y) (* z y))

    1. Initial program 38.2

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied add-cube-cbrt38.6

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

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

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

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

    if -1.7752227888120415e+293 < (- (* x y) (* z y)) < -5.7409949950736745e-146 or 6.1708799165572e-321 < (- (* x y) (* z y)) < 3.1698261024189057e+198

    1. Initial program 0.3

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

    if -5.7409949950736745e-146 < (- (* x y) (* z y)) < 6.1708799165572e-321

    1. Initial program 9.4

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

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

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

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

Reproduce

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

  :herbie-target
  (if (< t -9.2318795828867769e-80) (* (* y t) (- x z)) (if (< t 2.5430670515648771e83) (* y (* t (- x z))) (* (* y (- x z)) t)))

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