Linear.Projection:inverseInfinitePerspective from linear-1.19.1.3

Percentage Accurate: 90.5% → 99.5%
Time: 2.3s
Alternatives: 6
Speedup: 0.9×

Specification

?
\[\left(x \cdot y - z \cdot y\right) \cdot t \]
(FPCore (x y z t)
  :precision binary64
  :pre TRUE
  (* (- (* x y) (* z y)) t))
double code(double x, double y, double z, double t) {
	return ((x * y) - (z * y)) * t;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x * y) - (z * y)) * t
end function
public static double code(double x, double y, double z, double t) {
	return ((x * y) - (z * y)) * t;
}
def code(x, y, z, t):
	return ((x * y) - (z * y)) * t
function code(x, y, z, t)
	return Float64(Float64(Float64(x * y) - Float64(z * y)) * t)
end
function tmp = code(x, y, z, t)
	tmp = ((x * y) - (z * y)) * t;
end
code[x_, y_, z_, t_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
f(x, y, z, t):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf],
	t in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z, t: real): real =
	((x * y) - (z * y)) * t
END code
\left(x \cdot y - z \cdot y\right) \cdot t

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 6 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 90.5% accurate, 1.0× speedup?

\[\left(x \cdot y - z \cdot y\right) \cdot t \]
(FPCore (x y z t)
  :precision binary64
  :pre TRUE
  (* (- (* x y) (* z y)) t))
double code(double x, double y, double z, double t) {
	return ((x * y) - (z * y)) * t;
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = ((x * y) - (z * y)) * t
end function
public static double code(double x, double y, double z, double t) {
	return ((x * y) - (z * y)) * t;
}
def code(x, y, z, t):
	return ((x * y) - (z * y)) * t
function code(x, y, z, t)
	return Float64(Float64(Float64(x * y) - Float64(z * y)) * t)
end
function tmp = code(x, y, z, t)
	tmp = ((x * y) - (z * y)) * t;
end
code[x_, y_, z_, t_] := N[(N[(N[(x * y), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
f(x, y, z, t):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf],
	t in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z, t: real): real =
	((x * y) - (z * y)) * t
END code
\left(x \cdot y - z \cdot y\right) \cdot t

Alternative 1: 99.5% accurate, 0.1× speedup?

\[\begin{array}{l} t_1 := \mathsf{min}\left(\left|y\right|, \left|t\right|\right)\\ t_2 := \mathsf{max}\left(\left|y\right|, \left|t\right|\right)\\ t_3 := \left(t\_1 \cdot \left(x - z\right)\right) \cdot t\_2\\ t_4 := \left(x \cdot t\_1 - z \cdot t\_1\right) \cdot t\_2\\ \mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l} \mathbf{if}\;t\_4 \leq -1 \cdot 10^{-13}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_4 \leq 10^{+34}:\\ \;\;\;\;t\_1 \cdot \left(\left(x - z\right) \cdot t\_2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array}\right) \end{array} \]
(FPCore (x y z t)
  :precision binary64
  :pre TRUE
  (let* ((t_1 (fmin (fabs y) (fabs t)))
       (t_2 (fmax (fabs y) (fabs t)))
       (t_3 (* (* t_1 (- x z)) t_2))
       (t_4 (* (- (* x t_1) (* z t_1)) t_2)))
  (*
   (copysign 1.0 y)
   (*
    (copysign 1.0 t)
    (if (<= t_4 -1e-13)
      t_3
      (if (<= t_4 1e+34) (* t_1 (* (- x z) t_2)) t_3))))))
double code(double x, double y, double z, double t) {
	double t_1 = fmin(fabs(y), fabs(t));
	double t_2 = fmax(fabs(y), fabs(t));
	double t_3 = (t_1 * (x - z)) * t_2;
	double t_4 = ((x * t_1) - (z * t_1)) * t_2;
	double tmp;
	if (t_4 <= -1e-13) {
		tmp = t_3;
	} else if (t_4 <= 1e+34) {
		tmp = t_1 * ((x - z) * t_2);
	} else {
		tmp = t_3;
	}
	return copysign(1.0, y) * (copysign(1.0, t) * tmp);
}
public static double code(double x, double y, double z, double t) {
	double t_1 = fmin(Math.abs(y), Math.abs(t));
	double t_2 = fmax(Math.abs(y), Math.abs(t));
	double t_3 = (t_1 * (x - z)) * t_2;
	double t_4 = ((x * t_1) - (z * t_1)) * t_2;
	double tmp;
	if (t_4 <= -1e-13) {
		tmp = t_3;
	} else if (t_4 <= 1e+34) {
		tmp = t_1 * ((x - z) * t_2);
	} else {
		tmp = t_3;
	}
	return Math.copySign(1.0, y) * (Math.copySign(1.0, t) * tmp);
}
def code(x, y, z, t):
	t_1 = fmin(math.fabs(y), math.fabs(t))
	t_2 = fmax(math.fabs(y), math.fabs(t))
	t_3 = (t_1 * (x - z)) * t_2
	t_4 = ((x * t_1) - (z * t_1)) * t_2
	tmp = 0
	if t_4 <= -1e-13:
		tmp = t_3
	elif t_4 <= 1e+34:
		tmp = t_1 * ((x - z) * t_2)
	else:
		tmp = t_3
	return math.copysign(1.0, y) * (math.copysign(1.0, t) * tmp)
function code(x, y, z, t)
	t_1 = fmin(abs(y), abs(t))
	t_2 = fmax(abs(y), abs(t))
	t_3 = Float64(Float64(t_1 * Float64(x - z)) * t_2)
	t_4 = Float64(Float64(Float64(x * t_1) - Float64(z * t_1)) * t_2)
	tmp = 0.0
	if (t_4 <= -1e-13)
		tmp = t_3;
	elseif (t_4 <= 1e+34)
		tmp = Float64(t_1 * Float64(Float64(x - z) * t_2));
	else
		tmp = t_3;
	end
	return Float64(copysign(1.0, y) * Float64(copysign(1.0, t) * tmp))
end
function tmp_2 = code(x, y, z, t)
	t_1 = min(abs(y), abs(t));
	t_2 = max(abs(y), abs(t));
	t_3 = (t_1 * (x - z)) * t_2;
	t_4 = ((x * t_1) - (z * t_1)) * t_2;
	tmp = 0.0;
	if (t_4 <= -1e-13)
		tmp = t_3;
	elseif (t_4 <= 1e+34)
		tmp = t_1 * ((x - z) * t_2);
	else
		tmp = t_3;
	end
	tmp_2 = (sign(y) * abs(1.0)) * ((sign(t) * abs(1.0)) * tmp);
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Min[N[Abs[y], $MachinePrecision], N[Abs[t], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Abs[y], $MachinePrecision], N[Abs[t], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 * N[(x - z), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * t$95$1), $MachinePrecision] - N[(z * t$95$1), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$4, -1e-13], t$95$3, If[LessEqual[t$95$4, 1e+34], N[(t$95$1 * N[(N[(x - z), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], t$95$3]]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(\left|y\right|, \left|t\right|\right)\\
t_2 := \mathsf{max}\left(\left|y\right|, \left|t\right|\right)\\
t_3 := \left(t\_1 \cdot \left(x - z\right)\right) \cdot t\_2\\
t_4 := \left(x \cdot t\_1 - z \cdot t\_1\right) \cdot t\_2\\
\mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_4 \leq -1 \cdot 10^{-13}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_4 \leq 10^{+34}:\\
\;\;\;\;t\_1 \cdot \left(\left(x - z\right) \cdot t\_2\right)\\

\mathbf{else}:\\
\;\;\;\;t\_3\\


\end{array}\right)
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 (*.f64 x y) (*.f64 z y)) t) < -1e-13 or 9.9999999999999995e33 < (*.f64 (-.f64 (*.f64 x y) (*.f64 z y)) t)

    1. Initial program 90.5%

      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
    2. Taylor expanded in y around 0

      \[\leadsto \left(y \cdot \left(x - z\right)\right) \cdot t \]
    3. Step-by-step derivation
      1. Applied rewrites92.0%

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

      if -1e-13 < (*.f64 (-.f64 (*.f64 x y) (*.f64 z y)) t) < 9.9999999999999995e33

      1. Initial program 90.5%

        \[\left(x \cdot y - z \cdot y\right) \cdot t \]
      2. Step-by-step derivation
        1. Applied rewrites92.1%

          \[\leadsto y \cdot \left(\left(x - z\right) \cdot t\right) \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 2: 98.3% accurate, 0.3× speedup?

      \[\begin{array}{l} t_1 := \mathsf{min}\left(\left|y\right|, \left|t\right|\right)\\ t_2 := \mathsf{max}\left(\left|y\right|, \left|t\right|\right)\\ \mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq 7.825399874758337 \cdot 10^{-21}:\\ \;\;\;\;t\_1 \cdot \left(\left(x - z\right) \cdot t\_2\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t\_2 \cdot t\_1\right) \cdot \left(x - z\right)\\ \end{array}\right) \end{array} \]
      (FPCore (x y z t)
        :precision binary64
        :pre TRUE
        (let* ((t_1 (fmin (fabs y) (fabs t))) (t_2 (fmax (fabs y) (fabs t))))
        (*
         (copysign 1.0 y)
         (*
          (copysign 1.0 t)
          (if (<= t_2 7.825399874758337e-21)
            (* t_1 (* (- x z) t_2))
            (* (* t_2 t_1) (- x z)))))))
      double code(double x, double y, double z, double t) {
      	double t_1 = fmin(fabs(y), fabs(t));
      	double t_2 = fmax(fabs(y), fabs(t));
      	double tmp;
      	if (t_2 <= 7.825399874758337e-21) {
      		tmp = t_1 * ((x - z) * t_2);
      	} else {
      		tmp = (t_2 * t_1) * (x - z);
      	}
      	return copysign(1.0, y) * (copysign(1.0, t) * tmp);
      }
      
      public static double code(double x, double y, double z, double t) {
      	double t_1 = fmin(Math.abs(y), Math.abs(t));
      	double t_2 = fmax(Math.abs(y), Math.abs(t));
      	double tmp;
      	if (t_2 <= 7.825399874758337e-21) {
      		tmp = t_1 * ((x - z) * t_2);
      	} else {
      		tmp = (t_2 * t_1) * (x - z);
      	}
      	return Math.copySign(1.0, y) * (Math.copySign(1.0, t) * tmp);
      }
      
      def code(x, y, z, t):
      	t_1 = fmin(math.fabs(y), math.fabs(t))
      	t_2 = fmax(math.fabs(y), math.fabs(t))
      	tmp = 0
      	if t_2 <= 7.825399874758337e-21:
      		tmp = t_1 * ((x - z) * t_2)
      	else:
      		tmp = (t_2 * t_1) * (x - z)
      	return math.copysign(1.0, y) * (math.copysign(1.0, t) * tmp)
      
      function code(x, y, z, t)
      	t_1 = fmin(abs(y), abs(t))
      	t_2 = fmax(abs(y), abs(t))
      	tmp = 0.0
      	if (t_2 <= 7.825399874758337e-21)
      		tmp = Float64(t_1 * Float64(Float64(x - z) * t_2));
      	else
      		tmp = Float64(Float64(t_2 * t_1) * Float64(x - z));
      	end
      	return Float64(copysign(1.0, y) * Float64(copysign(1.0, t) * tmp))
      end
      
      function tmp_2 = code(x, y, z, t)
      	t_1 = min(abs(y), abs(t));
      	t_2 = max(abs(y), abs(t));
      	tmp = 0.0;
      	if (t_2 <= 7.825399874758337e-21)
      		tmp = t_1 * ((x - z) * t_2);
      	else
      		tmp = (t_2 * t_1) * (x - z);
      	end
      	tmp_2 = (sign(y) * abs(1.0)) * ((sign(t) * abs(1.0)) * tmp);
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[Min[N[Abs[y], $MachinePrecision], N[Abs[t], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Abs[y], $MachinePrecision], N[Abs[t], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$2, 7.825399874758337e-21], N[(t$95$1 * N[(N[(x - z), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 * t$95$1), $MachinePrecision] * N[(x - z), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      t_1 := \mathsf{min}\left(\left|y\right|, \left|t\right|\right)\\
      t_2 := \mathsf{max}\left(\left|y\right|, \left|t\right|\right)\\
      \mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
      \mathbf{if}\;t\_2 \leq 7.825399874758337 \cdot 10^{-21}:\\
      \;\;\;\;t\_1 \cdot \left(\left(x - z\right) \cdot t\_2\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(t\_2 \cdot t\_1\right) \cdot \left(x - z\right)\\
      
      
      \end{array}\right)
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < 7.825399874758337e-21

        1. Initial program 90.5%

          \[\left(x \cdot y - z \cdot y\right) \cdot t \]
        2. Step-by-step derivation
          1. Applied rewrites92.1%

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

          if 7.825399874758337e-21 < t

          1. Initial program 90.5%

            \[\left(x \cdot y - z \cdot y\right) \cdot t \]
          2. Step-by-step derivation
            1. Applied rewrites92.0%

              \[\leadsto \left(t \cdot y\right) \cdot \left(x - z\right) \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 3: 91.2% accurate, 0.9× speedup?

          \[\begin{array}{l} \mathbf{if}\;x \leq 2.7611275205280107 \cdot 10^{+180}:\\ \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(x \cdot y\right)\\ \end{array} \]
          (FPCore (x y z t)
            :precision binary64
            :pre TRUE
            (if (<= x 2.7611275205280107e+180) (* y (* (- x z) t)) (* t (* x y))))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (x <= 2.7611275205280107e+180) {
          		tmp = y * ((x - z) * t);
          	} else {
          		tmp = t * (x * y);
          	}
          	return tmp;
          }
          
          real(8) function code(x, y, z, t)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8) :: tmp
              if (x <= 2.7611275205280107d+180) then
                  tmp = y * ((x - z) * t)
              else
                  tmp = t * (x * y)
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double tmp;
          	if (x <= 2.7611275205280107e+180) {
          		tmp = y * ((x - z) * t);
          	} else {
          		tmp = t * (x * y);
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	tmp = 0
          	if x <= 2.7611275205280107e+180:
          		tmp = y * ((x - z) * t)
          	else:
          		tmp = t * (x * y)
          	return tmp
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if (x <= 2.7611275205280107e+180)
          		tmp = Float64(y * Float64(Float64(x - z) * t));
          	else
          		tmp = Float64(t * Float64(x * y));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	tmp = 0.0;
          	if (x <= 2.7611275205280107e+180)
          		tmp = y * ((x - z) * t);
          	else
          		tmp = t * (x * y);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := If[LessEqual[x, 2.7611275205280107e+180], N[(y * N[(N[(x - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]]
          
          f(x, y, z, t):
          	x in [-inf, +inf],
          	y in [-inf, +inf],
          	z in [-inf, +inf],
          	t in [-inf, +inf]
          code: THEORY
          BEGIN
          f(x, y, z, t: real): real =
          	LET tmp = IF (x <= (2761127520528010725143187158635350542126058317478749032429697251553016806515811491581073856237179998103849536393422360095080879370993818931168039324562157286764221760023357204463616)) THEN (y * ((x - z) * t)) ELSE (t * (x * y)) ENDIF IN
          	tmp
          END code
          \begin{array}{l}
          \mathbf{if}\;x \leq 2.7611275205280107 \cdot 10^{+180}:\\
          \;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t \cdot \left(x \cdot y\right)\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < 2.7611275205280107e180

            1. Initial program 90.5%

              \[\left(x \cdot y - z \cdot y\right) \cdot t \]
            2. Step-by-step derivation
              1. Applied rewrites92.1%

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

              if 2.7611275205280107e180 < x

              1. Initial program 90.5%

                \[\left(x \cdot y - z \cdot y\right) \cdot t \]
              2. Taylor expanded in x around inf

                \[\leadsto t \cdot \left(x \cdot y\right) \]
              3. Step-by-step derivation
                1. Applied rewrites53.4%

                  \[\leadsto t \cdot \left(x \cdot y\right) \]
              4. Recombined 2 regimes into one program.
              5. Add Preprocessing

              Alternative 4: 57.5% accurate, 0.3× speedup?

              \[\begin{array}{l} t_1 := \mathsf{min}\left(\left|y\right|, \left|t\right|\right)\\ t_2 := \mathsf{max}\left(\left|y\right|, \left|t\right|\right)\\ \mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq 1.650261910233758 \cdot 10^{+70}:\\ \;\;\;\;t\_1 \cdot \left(t\_2 \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t\_2 \cdot t\_1\right)\\ \end{array}\right) \end{array} \]
              (FPCore (x y z t)
                :precision binary64
                :pre TRUE
                (let* ((t_1 (fmin (fabs y) (fabs t))) (t_2 (fmax (fabs y) (fabs t))))
                (*
                 (copysign 1.0 y)
                 (*
                  (copysign 1.0 t)
                  (if (<= t_2 1.650261910233758e+70)
                    (* t_1 (* t_2 x))
                    (* x (* t_2 t_1)))))))
              double code(double x, double y, double z, double t) {
              	double t_1 = fmin(fabs(y), fabs(t));
              	double t_2 = fmax(fabs(y), fabs(t));
              	double tmp;
              	if (t_2 <= 1.650261910233758e+70) {
              		tmp = t_1 * (t_2 * x);
              	} else {
              		tmp = x * (t_2 * t_1);
              	}
              	return copysign(1.0, y) * (copysign(1.0, t) * tmp);
              }
              
              public static double code(double x, double y, double z, double t) {
              	double t_1 = fmin(Math.abs(y), Math.abs(t));
              	double t_2 = fmax(Math.abs(y), Math.abs(t));
              	double tmp;
              	if (t_2 <= 1.650261910233758e+70) {
              		tmp = t_1 * (t_2 * x);
              	} else {
              		tmp = x * (t_2 * t_1);
              	}
              	return Math.copySign(1.0, y) * (Math.copySign(1.0, t) * tmp);
              }
              
              def code(x, y, z, t):
              	t_1 = fmin(math.fabs(y), math.fabs(t))
              	t_2 = fmax(math.fabs(y), math.fabs(t))
              	tmp = 0
              	if t_2 <= 1.650261910233758e+70:
              		tmp = t_1 * (t_2 * x)
              	else:
              		tmp = x * (t_2 * t_1)
              	return math.copysign(1.0, y) * (math.copysign(1.0, t) * tmp)
              
              function code(x, y, z, t)
              	t_1 = fmin(abs(y), abs(t))
              	t_2 = fmax(abs(y), abs(t))
              	tmp = 0.0
              	if (t_2 <= 1.650261910233758e+70)
              		tmp = Float64(t_1 * Float64(t_2 * x));
              	else
              		tmp = Float64(x * Float64(t_2 * t_1));
              	end
              	return Float64(copysign(1.0, y) * Float64(copysign(1.0, t) * tmp))
              end
              
              function tmp_2 = code(x, y, z, t)
              	t_1 = min(abs(y), abs(t));
              	t_2 = max(abs(y), abs(t));
              	tmp = 0.0;
              	if (t_2 <= 1.650261910233758e+70)
              		tmp = t_1 * (t_2 * x);
              	else
              		tmp = x * (t_2 * t_1);
              	end
              	tmp_2 = (sign(y) * abs(1.0)) * ((sign(t) * abs(1.0)) * tmp);
              end
              
              code[x_, y_, z_, t_] := Block[{t$95$1 = N[Min[N[Abs[y], $MachinePrecision], N[Abs[t], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Abs[y], $MachinePrecision], N[Abs[t], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$2, 1.650261910233758e+70], N[(t$95$1 * N[(t$95$2 * x), $MachinePrecision]), $MachinePrecision], N[(x * N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              t_1 := \mathsf{min}\left(\left|y\right|, \left|t\right|\right)\\
              t_2 := \mathsf{max}\left(\left|y\right|, \left|t\right|\right)\\
              \mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
              \mathbf{if}\;t\_2 \leq 1.650261910233758 \cdot 10^{+70}:\\
              \;\;\;\;t\_1 \cdot \left(t\_2 \cdot x\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;x \cdot \left(t\_2 \cdot t\_1\right)\\
              
              
              \end{array}\right)
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if t < 1.6502619102337581e70

                1. Initial program 90.5%

                  \[\left(x \cdot y - z \cdot y\right) \cdot t \]
                2. Taylor expanded in x around inf

                  \[\leadsto t \cdot \left(x \cdot y\right) \]
                3. Step-by-step derivation
                  1. Applied rewrites53.4%

                    \[\leadsto t \cdot \left(x \cdot y\right) \]
                  2. Step-by-step derivation
                    1. Applied rewrites53.3%

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

                    if 1.6502619102337581e70 < t

                    1. Initial program 90.5%

                      \[\left(x \cdot y - z \cdot y\right) \cdot t \]
                    2. Taylor expanded in x around inf

                      \[\leadsto t \cdot \left(x \cdot y\right) \]
                    3. Step-by-step derivation
                      1. Applied rewrites53.4%

                        \[\leadsto t \cdot \left(x \cdot y\right) \]
                      2. Step-by-step derivation
                        1. Applied rewrites54.5%

                          \[\leadsto x \cdot \left(t \cdot y\right) \]
                      3. Recombined 2 regimes into one program.
                      4. Add Preprocessing

                      Alternative 5: 57.1% accurate, 0.3× speedup?

                      \[\begin{array}{l} t_1 := \mathsf{min}\left(\left|y\right|, \left|t\right|\right)\\ t_2 := \mathsf{max}\left(\left|y\right|, \left|t\right|\right)\\ \mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq 1.4055685462936228 \cdot 10^{-52}:\\ \;\;\;\;t\_2 \cdot \left(x \cdot t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(t\_2 \cdot t\_1\right)\\ \end{array}\right) \end{array} \]
                      (FPCore (x y z t)
                        :precision binary64
                        :pre TRUE
                        (let* ((t_1 (fmin (fabs y) (fabs t))) (t_2 (fmax (fabs y) (fabs t))))
                        (*
                         (copysign 1.0 y)
                         (*
                          (copysign 1.0 t)
                          (if (<= t_2 1.4055685462936228e-52)
                            (* t_2 (* x t_1))
                            (* x (* t_2 t_1)))))))
                      double code(double x, double y, double z, double t) {
                      	double t_1 = fmin(fabs(y), fabs(t));
                      	double t_2 = fmax(fabs(y), fabs(t));
                      	double tmp;
                      	if (t_2 <= 1.4055685462936228e-52) {
                      		tmp = t_2 * (x * t_1);
                      	} else {
                      		tmp = x * (t_2 * t_1);
                      	}
                      	return copysign(1.0, y) * (copysign(1.0, t) * tmp);
                      }
                      
                      public static double code(double x, double y, double z, double t) {
                      	double t_1 = fmin(Math.abs(y), Math.abs(t));
                      	double t_2 = fmax(Math.abs(y), Math.abs(t));
                      	double tmp;
                      	if (t_2 <= 1.4055685462936228e-52) {
                      		tmp = t_2 * (x * t_1);
                      	} else {
                      		tmp = x * (t_2 * t_1);
                      	}
                      	return Math.copySign(1.0, y) * (Math.copySign(1.0, t) * tmp);
                      }
                      
                      def code(x, y, z, t):
                      	t_1 = fmin(math.fabs(y), math.fabs(t))
                      	t_2 = fmax(math.fabs(y), math.fabs(t))
                      	tmp = 0
                      	if t_2 <= 1.4055685462936228e-52:
                      		tmp = t_2 * (x * t_1)
                      	else:
                      		tmp = x * (t_2 * t_1)
                      	return math.copysign(1.0, y) * (math.copysign(1.0, t) * tmp)
                      
                      function code(x, y, z, t)
                      	t_1 = fmin(abs(y), abs(t))
                      	t_2 = fmax(abs(y), abs(t))
                      	tmp = 0.0
                      	if (t_2 <= 1.4055685462936228e-52)
                      		tmp = Float64(t_2 * Float64(x * t_1));
                      	else
                      		tmp = Float64(x * Float64(t_2 * t_1));
                      	end
                      	return Float64(copysign(1.0, y) * Float64(copysign(1.0, t) * tmp))
                      end
                      
                      function tmp_2 = code(x, y, z, t)
                      	t_1 = min(abs(y), abs(t));
                      	t_2 = max(abs(y), abs(t));
                      	tmp = 0.0;
                      	if (t_2 <= 1.4055685462936228e-52)
                      		tmp = t_2 * (x * t_1);
                      	else
                      		tmp = x * (t_2 * t_1);
                      	end
                      	tmp_2 = (sign(y) * abs(1.0)) * ((sign(t) * abs(1.0)) * tmp);
                      end
                      
                      code[x_, y_, z_, t_] := Block[{t$95$1 = N[Min[N[Abs[y], $MachinePrecision], N[Abs[t], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Abs[y], $MachinePrecision], N[Abs[t], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$2, 1.4055685462936228e-52], N[(t$95$2 * N[(x * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x * N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      t_1 := \mathsf{min}\left(\left|y\right|, \left|t\right|\right)\\
                      t_2 := \mathsf{max}\left(\left|y\right|, \left|t\right|\right)\\
                      \mathsf{copysign}\left(1, y\right) \cdot \left(\mathsf{copysign}\left(1, t\right) \cdot \begin{array}{l}
                      \mathbf{if}\;t\_2 \leq 1.4055685462936228 \cdot 10^{-52}:\\
                      \;\;\;\;t\_2 \cdot \left(x \cdot t\_1\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;x \cdot \left(t\_2 \cdot t\_1\right)\\
                      
                      
                      \end{array}\right)
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if t < 1.4055685462936228e-52

                        1. Initial program 90.5%

                          \[\left(x \cdot y - z \cdot y\right) \cdot t \]
                        2. Taylor expanded in x around inf

                          \[\leadsto t \cdot \left(x \cdot y\right) \]
                        3. Step-by-step derivation
                          1. Applied rewrites53.4%

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

                          if 1.4055685462936228e-52 < t

                          1. Initial program 90.5%

                            \[\left(x \cdot y - z \cdot y\right) \cdot t \]
                          2. Taylor expanded in x around inf

                            \[\leadsto t \cdot \left(x \cdot y\right) \]
                          3. Step-by-step derivation
                            1. Applied rewrites53.4%

                              \[\leadsto t \cdot \left(x \cdot y\right) \]
                            2. Step-by-step derivation
                              1. Applied rewrites54.5%

                                \[\leadsto x \cdot \left(t \cdot y\right) \]
                            3. Recombined 2 regimes into one program.
                            4. Add Preprocessing

                            Alternative 6: 53.4% accurate, 1.8× speedup?

                            \[t \cdot \left(x \cdot y\right) \]
                            (FPCore (x y z t)
                              :precision binary64
                              :pre TRUE
                              (* t (* x y)))
                            double code(double x, double y, double z, double t) {
                            	return t * (x * y);
                            }
                            
                            real(8) function code(x, y, z, t)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                code = t * (x * y)
                            end function
                            
                            public static double code(double x, double y, double z, double t) {
                            	return t * (x * y);
                            }
                            
                            def code(x, y, z, t):
                            	return t * (x * y)
                            
                            function code(x, y, z, t)
                            	return Float64(t * Float64(x * y))
                            end
                            
                            function tmp = code(x, y, z, t)
                            	tmp = t * (x * y);
                            end
                            
                            code[x_, y_, z_, t_] := N[(t * N[(x * y), $MachinePrecision]), $MachinePrecision]
                            
                            f(x, y, z, t):
                            	x in [-inf, +inf],
                            	y in [-inf, +inf],
                            	z in [-inf, +inf],
                            	t in [-inf, +inf]
                            code: THEORY
                            BEGIN
                            f(x, y, z, t: real): real =
                            	t * (x * y)
                            END code
                            t \cdot \left(x \cdot y\right)
                            
                            Derivation
                            1. Initial program 90.5%

                              \[\left(x \cdot y - z \cdot y\right) \cdot t \]
                            2. Taylor expanded in x around inf

                              \[\leadsto t \cdot \left(x \cdot y\right) \]
                            3. Step-by-step derivation
                              1. Applied rewrites53.4%

                                \[\leadsto t \cdot \left(x \cdot y\right) \]
                              2. Add Preprocessing

                              Reproduce

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