
(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 5 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}
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function. (FPCore (t_s x y z t_m) :precision binary64 (* t_s (if (<= t_m 1.8e-42) (* y (* (- x z) t_m)) (* (- x z) (* y t_m)))))
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y && y < z && z < t_m);
double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (t_m <= 1.8e-42) {
tmp = y * ((x - z) * t_m);
} else {
tmp = (x - z) * (y * t_m);
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 1.8d-42) then
tmp = y * ((x - z) * t_m)
else
tmp = (x - z) * (y * t_m)
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y && y < z && z < t_m;
public static double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (t_m <= 1.8e-42) {
tmp = y * ((x - z) * t_m);
} else {
tmp = (x - z) * (y * t_m);
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) [x, y, z, t_m] = sort([x, y, z, t_m]) def code(t_s, x, y, z, t_m): tmp = 0 if t_m <= 1.8e-42: tmp = y * ((x - z) * t_m) else: tmp = (x - z) * (y * t_m) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) x, y, z, t_m = sort([x, y, z, t_m]) function code(t_s, x, y, z, t_m) tmp = 0.0 if (t_m <= 1.8e-42) tmp = Float64(y * Float64(Float64(x - z) * t_m)); else tmp = Float64(Float64(x - z) * Float64(y * t_m)); end return Float64(t_s * tmp) end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y, z, t_m = num2cell(sort([x, y, z, t_m])){:}
function tmp_2 = code(t_s, x, y, z, t_m)
tmp = 0.0;
if (t_m <= 1.8e-42)
tmp = y * ((x - z) * t_m);
else
tmp = (x - z) * (y * t_m);
end
tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[t$95$m, 1.8e-42], N[(y * N[(N[(x - z), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(x - z), $MachinePrecision] * N[(y * t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y, z, t_m] = \mathsf{sort}([x, y, z, t_m])\\
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 1.8 \cdot 10^{-42}:\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - z\right) \cdot \left(y \cdot t\_m\right)\\
\end{array}
\end{array}
if t < 1.8000000000000001e-42Initial program 86.0%
distribute-rgt-out--88.3%
associate-*l*96.1%
*-commutative96.1%
Simplified96.1%
if 1.8000000000000001e-42 < t Initial program 94.7%
*-commutative94.7%
distribute-rgt-out--94.7%
associate-*r*98.5%
*-commutative98.5%
Simplified98.5%
Final simplification96.8%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (<= x -2.35e+184)
(* t_m (* y x))
(if (or (<= x -2.4e-129) (not (<= x 5.8e-164)))
(* y (* (- x z) t_m))
(* t_m (* y (- z)))))))t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y && y < z && z < t_m);
double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (x <= -2.35e+184) {
tmp = t_m * (y * x);
} else if ((x <= -2.4e-129) || !(x <= 5.8e-164)) {
tmp = y * ((x - z) * t_m);
} else {
tmp = t_m * (y * -z);
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if (x <= (-2.35d+184)) then
tmp = t_m * (y * x)
else if ((x <= (-2.4d-129)) .or. (.not. (x <= 5.8d-164))) then
tmp = y * ((x - z) * t_m)
else
tmp = t_m * (y * -z)
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y && y < z && z < t_m;
public static double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if (x <= -2.35e+184) {
tmp = t_m * (y * x);
} else if ((x <= -2.4e-129) || !(x <= 5.8e-164)) {
tmp = y * ((x - z) * t_m);
} else {
tmp = t_m * (y * -z);
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) [x, y, z, t_m] = sort([x, y, z, t_m]) def code(t_s, x, y, z, t_m): tmp = 0 if x <= -2.35e+184: tmp = t_m * (y * x) elif (x <= -2.4e-129) or not (x <= 5.8e-164): tmp = y * ((x - z) * t_m) else: tmp = t_m * (y * -z) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) x, y, z, t_m = sort([x, y, z, t_m]) function code(t_s, x, y, z, t_m) tmp = 0.0 if (x <= -2.35e+184) tmp = Float64(t_m * Float64(y * x)); elseif ((x <= -2.4e-129) || !(x <= 5.8e-164)) tmp = Float64(y * Float64(Float64(x - z) * t_m)); else tmp = Float64(t_m * Float64(y * Float64(-z))); end return Float64(t_s * tmp) end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y, z, t_m = num2cell(sort([x, y, z, t_m])){:}
function tmp_2 = code(t_s, x, y, z, t_m)
tmp = 0.0;
if (x <= -2.35e+184)
tmp = t_m * (y * x);
elseif ((x <= -2.4e-129) || ~((x <= 5.8e-164)))
tmp = y * ((x - z) * t_m);
else
tmp = t_m * (y * -z);
end
tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[LessEqual[x, -2.35e+184], N[(t$95$m * N[(y * x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -2.4e-129], N[Not[LessEqual[x, 5.8e-164]], $MachinePrecision]], N[(y * N[(N[(x - z), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision], N[(t$95$m * N[(y * (-z)), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y, z, t_m] = \mathsf{sort}([x, y, z, t_m])\\
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -2.35 \cdot 10^{+184}:\\
\;\;\;\;t\_m \cdot \left(y \cdot x\right)\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{-129} \lor \neg \left(x \leq 5.8 \cdot 10^{-164}\right):\\
\;\;\;\;y \cdot \left(\left(x - z\right) \cdot t\_m\right)\\
\mathbf{else}:\\
\;\;\;\;t\_m \cdot \left(y \cdot \left(-z\right)\right)\\
\end{array}
\end{array}
if x < -2.3500000000000002e184Initial program 56.1%
distribute-rgt-out--61.2%
associate-*l*95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in x around inf 56.7%
*-commutative56.7%
Simplified56.7%
if -2.3500000000000002e184 < x < -2.39999999999999989e-129 or 5.8e-164 < x Initial program 91.6%
distribute-rgt-out--93.5%
associate-*l*95.1%
*-commutative95.1%
Simplified95.1%
if -2.39999999999999989e-129 < x < 5.8e-164Initial program 91.5%
distribute-rgt-out--91.5%
associate-*l*92.9%
*-commutative92.9%
Simplified92.9%
Taylor expanded in x around 0 89.1%
mul-1-neg89.1%
distribute-rgt-neg-in89.1%
distribute-rgt-neg-in89.1%
Simplified89.1%
Final simplification90.2%
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s x y z t_m)
:precision binary64
(*
t_s
(if (or (<= z -3.8e+56) (not (<= z 5.4e-9)))
(* t_m (* y (- z)))
(* t_m (* y x)))))t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y && y < z && z < t_m);
double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if ((z <= -3.8e+56) || !(z <= 5.4e-9)) {
tmp = t_m * (y * -z);
} else {
tmp = t_m * (y * x);
}
return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if ((z <= (-3.8d+56)) .or. (.not. (z <= 5.4d-9))) then
tmp = t_m * (y * -z)
else
tmp = t_m * (y * x)
end if
code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y && y < z && z < t_m;
public static double code(double t_s, double x, double y, double z, double t_m) {
double tmp;
if ((z <= -3.8e+56) || !(z <= 5.4e-9)) {
tmp = t_m * (y * -z);
} else {
tmp = t_m * (y * x);
}
return t_s * tmp;
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) [x, y, z, t_m] = sort([x, y, z, t_m]) def code(t_s, x, y, z, t_m): tmp = 0 if (z <= -3.8e+56) or not (z <= 5.4e-9): tmp = t_m * (y * -z) else: tmp = t_m * (y * x) return t_s * tmp
t_m = abs(t) t_s = copysign(1.0, t) x, y, z, t_m = sort([x, y, z, t_m]) function code(t_s, x, y, z, t_m) tmp = 0.0 if ((z <= -3.8e+56) || !(z <= 5.4e-9)) tmp = Float64(t_m * Float64(y * Float64(-z))); else tmp = Float64(t_m * Float64(y * x)); end return Float64(t_s * tmp) end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y, z, t_m = num2cell(sort([x, y, z, t_m])){:}
function tmp_2 = code(t_s, x, y, z, t_m)
tmp = 0.0;
if ((z <= -3.8e+56) || ~((z <= 5.4e-9)))
tmp = t_m * (y * -z);
else
tmp = t_m * (y * x);
end
tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * If[Or[LessEqual[z, -3.8e+56], N[Not[LessEqual[z, 5.4e-9]], $MachinePrecision]], N[(t$95$m * N[(y * (-z)), $MachinePrecision]), $MachinePrecision], N[(t$95$m * N[(y * x), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y, z, t_m] = \mathsf{sort}([x, y, z, t_m])\\
\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+56} \lor \neg \left(z \leq 5.4 \cdot 10^{-9}\right):\\
\;\;\;\;t\_m \cdot \left(y \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_m \cdot \left(y \cdot x\right)\\
\end{array}
\end{array}
if z < -3.79999999999999996e56 or 5.4000000000000004e-9 < z Initial program 85.8%
distribute-rgt-out--89.4%
associate-*l*92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in x around 0 73.0%
mul-1-neg73.0%
distribute-rgt-neg-in73.0%
distribute-rgt-neg-in73.0%
Simplified73.0%
if -3.79999999999999996e56 < z < 5.4000000000000004e-9Initial program 90.9%
distribute-rgt-out--90.9%
associate-*l*96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in x around inf 73.4%
*-commutative73.4%
Simplified73.4%
Final simplification73.2%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function. (FPCore (t_s x y z t_m) :precision binary64 (* t_s (* (* y (- x z)) t_m)))
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y && y < z && z < t_m);
double code(double t_s, double x, double y, double z, double t_m) {
return t_s * ((y * (x - z)) * t_m);
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = t_s * ((y * (x - z)) * t_m)
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y && y < z && z < t_m;
public static double code(double t_s, double x, double y, double z, double t_m) {
return t_s * ((y * (x - z)) * t_m);
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) [x, y, z, t_m] = sort([x, y, z, t_m]) def code(t_s, x, y, z, t_m): return t_s * ((y * (x - z)) * t_m)
t_m = abs(t) t_s = copysign(1.0, t) x, y, z, t_m = sort([x, y, z, t_m]) function code(t_s, x, y, z, t_m) return Float64(t_s * Float64(Float64(y * Float64(x - z)) * t_m)) end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y, z, t_m = num2cell(sort([x, y, z, t_m])){:}
function tmp = code(t_s, x, y, z, t_m)
tmp = t_s * ((y * (x - z)) * t_m);
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * N[(N[(y * N[(x - z), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y, z, t_m] = \mathsf{sort}([x, y, z, t_m])\\
\\
t\_s \cdot \left(\left(y \cdot \left(x - z\right)\right) \cdot t\_m\right)
\end{array}
Initial program 88.5%
distribute-rgt-out--90.2%
Simplified90.2%
Final simplification90.2%
t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function. (FPCore (t_s x y z t_m) :precision binary64 (* t_s (* t_m (* y x))))
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y && y < z && z < t_m);
double code(double t_s, double x, double y, double z, double t_m) {
return t_s * (t_m * (y * x));
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, x, y, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = t_s * (t_m * (y * x))
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y && y < z && z < t_m;
public static double code(double t_s, double x, double y, double z, double t_m) {
return t_s * (t_m * (y * x));
}
t_m = math.fabs(t) t_s = math.copysign(1.0, t) [x, y, z, t_m] = sort([x, y, z, t_m]) def code(t_s, x, y, z, t_m): return t_s * (t_m * (y * x))
t_m = abs(t) t_s = copysign(1.0, t) x, y, z, t_m = sort([x, y, z, t_m]) function code(t_s, x, y, z, t_m) return Float64(t_s * Float64(t_m * Float64(y * x))) end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y, z, t_m = num2cell(sort([x, y, z, t_m])){:}
function tmp = code(t_s, x, y, z, t_m)
tmp = t_s * (t_m * (y * x));
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: x, y, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, x_, y_, z_, t$95$m_] := N[(t$95$s * N[(t$95$m * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y, z, t_m] = \mathsf{sort}([x, y, z, t_m])\\
\\
t\_s \cdot \left(t\_m \cdot \left(y \cdot x\right)\right)
\end{array}
Initial program 88.5%
distribute-rgt-out--90.2%
associate-*l*94.5%
*-commutative94.5%
Simplified94.5%
Taylor expanded in x around inf 52.0%
*-commutative52.0%
Simplified52.0%
Final simplification52.0%
(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 2024034
(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))