Average Error: 6.8 → 3.5
Time: 23.7s
Precision: 64
\[\left(x \cdot y - z \cdot y\right) \cdot t\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.9633851905398058 \cdot 10^{+87}:\\ \;\;\;\;\left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot y\right) \cdot \left(\sqrt[3]{x - z} \cdot t\right)\\ \mathbf{elif}\;t \le 1.016524647392877 \cdot 10^{+40}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{t \cdot \left(y \cdot \left(x - z\right)\right)} \cdot \left(\sqrt[3]{t \cdot \left(y \cdot \left(x - z\right)\right)} \cdot \sqrt[3]{t \cdot \left(y \cdot \left(x - z\right)\right)}\right)\\ \end{array}\]
\left(x \cdot y - z \cdot y\right) \cdot t
\begin{array}{l}
\mathbf{if}\;t \le -1.9633851905398058 \cdot 10^{+87}:\\
\;\;\;\;\left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot y\right) \cdot \left(\sqrt[3]{x - z} \cdot t\right)\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r38339506 = x;
        double r38339507 = y;
        double r38339508 = r38339506 * r38339507;
        double r38339509 = z;
        double r38339510 = r38339509 * r38339507;
        double r38339511 = r38339508 - r38339510;
        double r38339512 = t;
        double r38339513 = r38339511 * r38339512;
        return r38339513;
}

double f(double x, double y, double z, double t) {
        double r38339514 = t;
        double r38339515 = -1.9633851905398058e+87;
        bool r38339516 = r38339514 <= r38339515;
        double r38339517 = x;
        double r38339518 = z;
        double r38339519 = r38339517 - r38339518;
        double r38339520 = cbrt(r38339519);
        double r38339521 = r38339520 * r38339520;
        double r38339522 = y;
        double r38339523 = r38339521 * r38339522;
        double r38339524 = r38339520 * r38339514;
        double r38339525 = r38339523 * r38339524;
        double r38339526 = 1.016524647392877e+40;
        bool r38339527 = r38339514 <= r38339526;
        double r38339528 = r38339514 * r38339519;
        double r38339529 = r38339528 * r38339522;
        double r38339530 = r38339522 * r38339519;
        double r38339531 = r38339514 * r38339530;
        double r38339532 = cbrt(r38339531);
        double r38339533 = r38339532 * r38339532;
        double r38339534 = r38339532 * r38339533;
        double r38339535 = r38339527 ? r38339529 : r38339534;
        double r38339536 = r38339516 ? r38339525 : r38339535;
        return r38339536;
}

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.8
Target3.1
Herbie3.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 t < -1.9633851905398058e+87

    1. Initial program 5.2

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied *-un-lft-identity5.2

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

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

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

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

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

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

    if -1.9633851905398058e+87 < t < 1.016524647392877e+40

    1. Initial program 7.6

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

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

      \[\leadsto \left(\color{blue}{y \cdot x} - y \cdot z\right) \cdot t\]
    5. Applied distribute-lft-out--7.6

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

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

    if 1.016524647392877e+40 < t

    1. Initial program 4.2

      \[\left(x \cdot y - z \cdot y\right) \cdot t\]
    2. Using strategy rm
    3. Applied *-un-lft-identity4.2

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

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

      \[\leadsto \color{blue}{\left(y \cdot \left(x - z\right)\right)} \cdot t\]
    6. Using strategy rm
    7. Applied add-cube-cbrt5.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.9633851905398058 \cdot 10^{+87}:\\ \;\;\;\;\left(\left(\sqrt[3]{x - z} \cdot \sqrt[3]{x - z}\right) \cdot y\right) \cdot \left(\sqrt[3]{x - z} \cdot t\right)\\ \mathbf{elif}\;t \le 1.016524647392877 \cdot 10^{+40}:\\ \;\;\;\;\left(t \cdot \left(x - z\right)\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{t \cdot \left(y \cdot \left(x - z\right)\right)} \cdot \left(\sqrt[3]{t \cdot \left(y \cdot \left(x - z\right)\right)} \cdot \sqrt[3]{t \cdot \left(y \cdot \left(x - z\right)\right)}\right)\\ \end{array}\]

Reproduce

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