
(FPCore (x y z t) :precision binary64 (* (- (* 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)
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]
\begin{array}{l}
\\
\left(x \cdot y - z \cdot y\right) \cdot t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (- (* 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)
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]
\begin{array}{l}
\\
\left(x \cdot y - z \cdot y\right) \cdot t
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t 0.002) (* y (* (- x z) t)) (* (- x z) (* y t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 0.002) {
tmp = y * ((x - z) * t);
} else {
tmp = (x - z) * (y * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 0.002d0) then
tmp = y * ((x - z) * t)
else
tmp = (x - z) * (y * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 0.002) {
tmp = y * ((x - z) * t);
} else {
tmp = (x - z) * (y * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 0.002: tmp = y * ((x - z) * t) else: tmp = (x - z) * (y * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 0.002) tmp = Float64(y * Float64(Float64(x - z) * t)); else tmp = Float64(Float64(x - z) * Float64(y * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 0.002)
tmp = y * ((x - z) * t);
else
tmp = (x - z) * (y * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 0.002], N[(y * N[(N[(x - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(N[(x - z), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.002:\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\right)\\
\end{array}
\end{array}
if t < 2e-3Initial program 86.4%
distribute-rgt-out--89.2%
associate-*l*91.9%
*-commutative91.9%
Simplified91.9%
if 2e-3 < t Initial program 97.6%
*-commutative97.6%
distribute-rgt-out--99.0%
associate-*r*97.0%
*-commutative97.0%
Simplified97.0%
Final simplification93.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -3e+151) (not (<= z 3.8e+163))) (* t (* y (- z))) (* y (* (- x z) t))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3e+151) || !(z <= 3.8e+163)) {
tmp = t * (y * -z);
} else {
tmp = y * ((x - z) * t);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-3d+151)) .or. (.not. (z <= 3.8d+163))) then
tmp = t * (y * -z)
else
tmp = y * ((x - z) * t)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3e+151) || !(z <= 3.8e+163)) {
tmp = t * (y * -z);
} else {
tmp = y * ((x - z) * t);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -3e+151) or not (z <= 3.8e+163): tmp = t * (y * -z) else: tmp = y * ((x - z) * t) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -3e+151) || !(z <= 3.8e+163)) tmp = Float64(t * Float64(y * Float64(-z))); else tmp = Float64(y * Float64(Float64(x - z) * t)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -3e+151) || ~((z <= 3.8e+163)))
tmp = t * (y * -z);
else
tmp = y * ((x - z) * t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3e+151], N[Not[LessEqual[z, 3.8e+163]], $MachinePrecision]], N[(t * N[(y * (-z)), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+151} \lor \neg \left(z \leq 3.8 \cdot 10^{+163}\right):\\
\;\;\;\;t \cdot \left(y \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\right)\\
\end{array}
\end{array}
if z < -2.9999999999999999e151 or 3.80000000000000008e163 < z Initial program 79.9%
distribute-rgt-out--86.5%
Simplified86.5%
Taylor expanded in x around 0 81.6%
mul-1-neg81.6%
distribute-rgt-neg-out81.6%
Simplified81.6%
if -2.9999999999999999e151 < z < 3.80000000000000008e163Initial program 93.6%
distribute-rgt-out--94.2%
associate-*l*93.6%
*-commutative93.6%
Simplified93.6%
Final simplification90.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -38000000.0) (not (<= z 9.8e-71))) (* z (* t (- y))) (* t (* y x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -38000000.0) || !(z <= 9.8e-71)) {
tmp = z * (t * -y);
} else {
tmp = t * (y * x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-38000000.0d0)) .or. (.not. (z <= 9.8d-71))) then
tmp = z * (t * -y)
else
tmp = t * (y * x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -38000000.0) || !(z <= 9.8e-71)) {
tmp = z * (t * -y);
} else {
tmp = t * (y * x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -38000000.0) or not (z <= 9.8e-71): tmp = z * (t * -y) else: tmp = t * (y * x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -38000000.0) || !(z <= 9.8e-71)) tmp = Float64(z * Float64(t * Float64(-y))); else tmp = Float64(t * Float64(y * x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -38000000.0) || ~((z <= 9.8e-71)))
tmp = z * (t * -y);
else
tmp = t * (y * x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -38000000.0], N[Not[LessEqual[z, 9.8e-71]], $MachinePrecision]], N[(z * N[(t * (-y)), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -38000000 \lor \neg \left(z \leq 9.8 \cdot 10^{-71}\right):\\
\;\;\;\;z \cdot \left(t \cdot \left(-y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot x\right)\\
\end{array}
\end{array}
if z < -3.8e7 or 9.7999999999999994e-71 < z Initial program 87.4%
distribute-rgt-out--91.4%
Simplified91.4%
Taylor expanded in x around 0 75.8%
mul-1-neg75.8%
distribute-rgt-neg-out75.8%
Simplified75.8%
distribute-rgt-neg-out75.8%
distribute-lft-neg-out75.8%
add-sqr-sqrt39.8%
sqrt-unprod33.4%
sqr-neg33.4%
sqrt-unprod4.0%
add-sqr-sqrt7.9%
*-commutative7.9%
associate-*l*7.9%
add-sqr-sqrt4.0%
sqrt-unprod32.7%
sqr-neg32.7%
sqrt-unprod39.8%
add-sqr-sqrt77.4%
Applied egg-rr77.4%
if -3.8e7 < z < 9.7999999999999994e-71Initial program 92.6%
distribute-rgt-out--92.6%
Simplified92.6%
Taylor expanded in x around inf 79.8%
*-commutative79.8%
Simplified79.8%
Final simplification78.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= z -9000000.0) (not (<= z 6.5e-71))) (* t (* y (- z))) (* t (* y x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9000000.0) || !(z <= 6.5e-71)) {
tmp = t * (y * -z);
} else {
tmp = t * (y * x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-9000000.0d0)) .or. (.not. (z <= 6.5d-71))) then
tmp = t * (y * -z)
else
tmp = t * (y * x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9000000.0) || !(z <= 6.5e-71)) {
tmp = t * (y * -z);
} else {
tmp = t * (y * x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z <= -9000000.0) or not (z <= 6.5e-71): tmp = t * (y * -z) else: tmp = t * (y * x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((z <= -9000000.0) || !(z <= 6.5e-71)) tmp = Float64(t * Float64(y * Float64(-z))); else tmp = Float64(t * Float64(y * x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z <= -9000000.0) || ~((z <= 6.5e-71)))
tmp = t * (y * -z);
else
tmp = t * (y * x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9000000.0], N[Not[LessEqual[z, 6.5e-71]], $MachinePrecision]], N[(t * N[(y * (-z)), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9000000 \lor \neg \left(z \leq 6.5 \cdot 10^{-71}\right):\\
\;\;\;\;t \cdot \left(y \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot x\right)\\
\end{array}
\end{array}
if z < -9e6 or 6.50000000000000005e-71 < z Initial program 87.4%
distribute-rgt-out--91.4%
Simplified91.4%
Taylor expanded in x around 0 75.8%
mul-1-neg75.8%
distribute-rgt-neg-out75.8%
Simplified75.8%
if -9e6 < z < 6.50000000000000005e-71Initial program 92.6%
distribute-rgt-out--92.6%
Simplified92.6%
Taylor expanded in x around inf 79.8%
*-commutative79.8%
Simplified79.8%
Final simplification77.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* (* y (- x z)) t))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (y * (x - z)) * t;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y * (x - z)) * t
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (y * (x - z)) * t;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (y * (x - z)) * t
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(y * Float64(x - z)) * t) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (y * (x - z)) * t;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(y * N[(x - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(y \cdot \left(x - z\right)\right) \cdot t
\end{array}
Initial program 89.4%
distribute-rgt-out--91.9%
Simplified91.9%
Final simplification91.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* y (* x t)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return y * (x * t);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * (x * t)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return y * (x * t);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return y * (x * t)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(y * Float64(x * t)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = y * (x * t);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(y * N[(x * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
y \cdot \left(x \cdot t\right)
\end{array}
Initial program 89.4%
distribute-rgt-out--91.9%
associate-*l*91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in x around inf 47.2%
Final simplification47.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* t (* y x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return t * (y * x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t * (y * x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return t * (y * x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return t * (y * x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(t * Float64(y * x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = t * (y * x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(t * N[(y * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
t \cdot \left(y \cdot x\right)
\end{array}
Initial program 89.4%
distribute-rgt-out--91.9%
Simplified91.9%
Taylor expanded in x around inf 46.3%
*-commutative46.3%
Simplified46.3%
Final simplification46.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* t 0.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return t * 0.0;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t * 0.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return t * 0.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return t * 0.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(t * 0.0) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = t * 0.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(t * 0.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
t \cdot 0
\end{array}
Initial program 89.4%
distribute-rgt-out--91.9%
associate-*l*91.5%
*-commutative91.5%
Simplified91.5%
*-commutative91.5%
associate-*l*91.9%
distribute-rgt-out--89.4%
*-commutative89.4%
prod-diff82.2%
*-commutative82.2%
fma-neg82.2%
distribute-rgt-in78.3%
distribute-rgt-out--79.5%
associate-*l*74.7%
*-commutative74.7%
*-commutative74.7%
add-sqr-sqrt40.8%
associate-*r*40.9%
fma-def40.9%
Applied egg-rr40.9%
Taylor expanded in y around 0 12.7%
+-commutative12.7%
distribute-lft-in12.5%
mul-1-neg12.5%
distribute-rgt-neg-in12.5%
mul-1-neg12.5%
distribute-lft1-in12.5%
metadata-eval12.5%
*-commutative12.5%
mul0-lft12.7%
Simplified12.7%
Final simplification12.7%
(FPCore (x y z t) :precision binary64 (if (< t -9.231879582886777e-80) (* (* y t) (- x z)) (if (< t 2.543067051564877e+83) (* y (* t (- x z))) (* (* y (- x z)) t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t < -9.231879582886777e-80) {
tmp = (y * t) * (x - z);
} else if (t < 2.543067051564877e+83) {
tmp = y * (t * (x - z));
} else {
tmp = (y * (x - z)) * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t < (-9.231879582886777d-80)) then
tmp = (y * t) * (x - z)
else if (t < 2.543067051564877d+83) then
tmp = y * (t * (x - z))
else
tmp = (y * (x - z)) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t < -9.231879582886777e-80) {
tmp = (y * t) * (x - z);
} else if (t < 2.543067051564877e+83) {
tmp = y * (t * (x - z));
} else {
tmp = (y * (x - z)) * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t < -9.231879582886777e-80: tmp = (y * t) * (x - z) elif t < 2.543067051564877e+83: tmp = y * (t * (x - z)) else: tmp = (y * (x - z)) * t return tmp
function code(x, y, z, t) tmp = 0.0 if (t < -9.231879582886777e-80) tmp = Float64(Float64(y * t) * Float64(x - z)); elseif (t < 2.543067051564877e+83) tmp = Float64(y * Float64(t * Float64(x - z))); else tmp = Float64(Float64(y * Float64(x - z)) * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t < -9.231879582886777e-80) tmp = (y * t) * (x - z); elseif (t < 2.543067051564877e+83) tmp = y * (t * (x - z)); else tmp = (y * (x - z)) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Less[t, -9.231879582886777e-80], N[(N[(y * t), $MachinePrecision] * N[(x - z), $MachinePrecision]), $MachinePrecision], If[Less[t, 2.543067051564877e+83], N[(y * N[(t * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(x - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t < -9.231879582886777 \cdot 10^{-80}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(x - z\right)\\
\mathbf{elif}\;t < 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}
\end{array}
herbie shell --seed 2024020
(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))