
(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}
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s y_s x y_m z t_m)
:precision binary64
(let* ((t_2 (* (- (* x y_m) (* y_m z)) t_m)))
(*
t_s
(*
y_s
(if (or (<= t_2 -200.0) (not (<= t_2 1e-152)))
(* t_m (* y_m (- x z)))
(* y_m (* t_m (- x z))))))))y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
double t_2 = ((x * y_m) - (y_m * z)) * t_m;
double tmp;
if ((t_2 <= -200.0) || !(t_2 <= 1e-152)) {
tmp = t_m * (y_m * (x - z));
} else {
tmp = y_m * (t_m * (x - z));
}
return t_s * (y_s * tmp);
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: t_2
real(8) :: tmp
t_2 = ((x * y_m) - (y_m * z)) * t_m
if ((t_2 <= (-200.0d0)) .or. (.not. (t_2 <= 1d-152))) then
tmp = t_m * (y_m * (x - z))
else
tmp = y_m * (t_m * (x - z))
end if
code = t_s * (y_s * tmp)
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
double t_2 = ((x * y_m) - (y_m * z)) * t_m;
double tmp;
if ((t_2 <= -200.0) || !(t_2 <= 1e-152)) {
tmp = t_m * (y_m * (x - z));
} else {
tmp = y_m * (t_m * (x - z));
}
return t_s * (y_s * tmp);
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) t_m = math.fabs(t) t_s = math.copysign(1.0, t) [x, y_m, z, t_m] = sort([x, y_m, z, t_m]) def code(t_s, y_s, x, y_m, z, t_m): t_2 = ((x * y_m) - (y_m * z)) * t_m tmp = 0 if (t_2 <= -200.0) or not (t_2 <= 1e-152): tmp = t_m * (y_m * (x - z)) else: tmp = y_m * (t_m * (x - z)) return t_s * (y_s * tmp)
y_m = abs(y) y_s = copysign(1.0, y) t_m = abs(t) t_s = copysign(1.0, t) x, y_m, z, t_m = sort([x, y_m, z, t_m]) function code(t_s, y_s, x, y_m, z, t_m) t_2 = Float64(Float64(Float64(x * y_m) - Float64(y_m * z)) * t_m) tmp = 0.0 if ((t_2 <= -200.0) || !(t_2 <= 1e-152)) tmp = Float64(t_m * Float64(y_m * Float64(x - z))); else tmp = Float64(y_m * Float64(t_m * Float64(x - z))); end return Float64(t_s * Float64(y_s * tmp)) end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp_2 = code(t_s, y_s, x, y_m, z, t_m)
t_2 = ((x * y_m) - (y_m * z)) * t_m;
tmp = 0.0;
if ((t_2 <= -200.0) || ~((t_2 <= 1e-152)))
tmp = t_m * (y_m * (x - z));
else
tmp = y_m * (t_m * (x - z));
end
tmp_2 = t_s * (y_s * tmp);
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
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_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := Block[{t$95$2 = N[(N[(N[(x * y$95$m), $MachinePrecision] - N[(y$95$m * z), $MachinePrecision]), $MachinePrecision] * t$95$m), $MachinePrecision]}, N[(t$95$s * N[(y$95$s * If[Or[LessEqual[t$95$2, -200.0], N[Not[LessEqual[t$95$2, 1e-152]], $MachinePrecision]], N[(t$95$m * N[(y$95$m * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y$95$m * N[(t$95$m * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
\begin{array}{l}
t_2 := \left(x \cdot y\_m - y\_m \cdot z\right) \cdot t\_m\\
t\_s \cdot \left(y\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -200 \lor \neg \left(t\_2 \leq 10^{-152}\right):\\
\;\;\;\;t\_m \cdot \left(y\_m \cdot \left(x - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot \left(t\_m \cdot \left(x - z\right)\right)\\
\end{array}\right)
\end{array}
\end{array}
if (*.f64 (-.f64 (*.f64 x y) (*.f64 z y)) t) < -200 or 1.00000000000000007e-152 < (*.f64 (-.f64 (*.f64 x y) (*.f64 z y)) t) Initial program 91.3%
distribute-rgt-out--91.4%
Simplified91.4%
if -200 < (*.f64 (-.f64 (*.f64 x y) (*.f64 z y)) t) < 1.00000000000000007e-152Initial program 93.0%
distribute-rgt-out--93.0%
associate-*l*95.2%
*-commutative95.2%
Simplified95.2%
Final simplification92.5%
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s y_s x y_m z t_m)
:precision binary64
(*
t_s
(*
y_s
(if (or (<= x -3.8e+216) (not (<= x 9e+213)))
(* (* x y_m) t_m)
(* y_m (* t_m (- x z)))))))y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
double tmp;
if ((x <= -3.8e+216) || !(x <= 9e+213)) {
tmp = (x * y_m) * t_m;
} else {
tmp = y_m * (t_m * (x - z));
}
return t_s * (y_s * tmp);
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if ((x <= (-3.8d+216)) .or. (.not. (x <= 9d+213))) then
tmp = (x * y_m) * t_m
else
tmp = y_m * (t_m * (x - z))
end if
code = t_s * (y_s * tmp)
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
double tmp;
if ((x <= -3.8e+216) || !(x <= 9e+213)) {
tmp = (x * y_m) * t_m;
} else {
tmp = y_m * (t_m * (x - z));
}
return t_s * (y_s * tmp);
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) t_m = math.fabs(t) t_s = math.copysign(1.0, t) [x, y_m, z, t_m] = sort([x, y_m, z, t_m]) def code(t_s, y_s, x, y_m, z, t_m): tmp = 0 if (x <= -3.8e+216) or not (x <= 9e+213): tmp = (x * y_m) * t_m else: tmp = y_m * (t_m * (x - z)) return t_s * (y_s * tmp)
y_m = abs(y) y_s = copysign(1.0, y) t_m = abs(t) t_s = copysign(1.0, t) x, y_m, z, t_m = sort([x, y_m, z, t_m]) function code(t_s, y_s, x, y_m, z, t_m) tmp = 0.0 if ((x <= -3.8e+216) || !(x <= 9e+213)) tmp = Float64(Float64(x * y_m) * t_m); else tmp = Float64(y_m * Float64(t_m * Float64(x - z))); end return Float64(t_s * Float64(y_s * tmp)) end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp_2 = code(t_s, y_s, x, y_m, z, t_m)
tmp = 0.0;
if ((x <= -3.8e+216) || ~((x <= 9e+213)))
tmp = (x * y_m) * t_m;
else
tmp = y_m * (t_m * (x - z));
end
tmp_2 = t_s * (y_s * tmp);
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
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_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * If[Or[LessEqual[x, -3.8e+216], N[Not[LessEqual[x, 9e+213]], $MachinePrecision]], N[(N[(x * y$95$m), $MachinePrecision] * t$95$m), $MachinePrecision], N[(y$95$m * N[(t$95$m * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t\_s \cdot \left(y\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{+216} \lor \neg \left(x \leq 9 \cdot 10^{+213}\right):\\
\;\;\;\;\left(x \cdot y\_m\right) \cdot t\_m\\
\mathbf{else}:\\
\;\;\;\;y\_m \cdot \left(t\_m \cdot \left(x - z\right)\right)\\
\end{array}\right)
\end{array}
if x < -3.80000000000000014e216 or 9.0000000000000003e213 < x Initial program 85.3%
distribute-rgt-out--85.5%
Simplified85.5%
Taylor expanded in x around inf 85.5%
*-commutative85.5%
Simplified85.5%
if -3.80000000000000014e216 < x < 9.0000000000000003e213Initial program 92.7%
distribute-rgt-out--92.8%
associate-*l*91.0%
*-commutative91.0%
Simplified91.0%
Final simplification90.3%
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s y_s x y_m z t_m)
:precision binary64
(*
t_s
(*
y_s
(if (or (<= z -7.5e-127) (not (<= z 5.8e-6)))
(* y_m (- (* z t_m)))
(* (* x y_m) t_m)))))y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
double tmp;
if ((z <= -7.5e-127) || !(z <= 5.8e-6)) {
tmp = y_m * -(z * t_m);
} else {
tmp = (x * y_m) * t_m;
}
return t_s * (y_s * tmp);
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if ((z <= (-7.5d-127)) .or. (.not. (z <= 5.8d-6))) then
tmp = y_m * -(z * t_m)
else
tmp = (x * y_m) * t_m
end if
code = t_s * (y_s * tmp)
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
double tmp;
if ((z <= -7.5e-127) || !(z <= 5.8e-6)) {
tmp = y_m * -(z * t_m);
} else {
tmp = (x * y_m) * t_m;
}
return t_s * (y_s * tmp);
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) t_m = math.fabs(t) t_s = math.copysign(1.0, t) [x, y_m, z, t_m] = sort([x, y_m, z, t_m]) def code(t_s, y_s, x, y_m, z, t_m): tmp = 0 if (z <= -7.5e-127) or not (z <= 5.8e-6): tmp = y_m * -(z * t_m) else: tmp = (x * y_m) * t_m return t_s * (y_s * tmp)
y_m = abs(y) y_s = copysign(1.0, y) t_m = abs(t) t_s = copysign(1.0, t) x, y_m, z, t_m = sort([x, y_m, z, t_m]) function code(t_s, y_s, x, y_m, z, t_m) tmp = 0.0 if ((z <= -7.5e-127) || !(z <= 5.8e-6)) tmp = Float64(y_m * Float64(-Float64(z * t_m))); else tmp = Float64(Float64(x * y_m) * t_m); end return Float64(t_s * Float64(y_s * tmp)) end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp_2 = code(t_s, y_s, x, y_m, z, t_m)
tmp = 0.0;
if ((z <= -7.5e-127) || ~((z <= 5.8e-6)))
tmp = y_m * -(z * t_m);
else
tmp = (x * y_m) * t_m;
end
tmp_2 = t_s * (y_s * tmp);
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
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_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * If[Or[LessEqual[z, -7.5e-127], N[Not[LessEqual[z, 5.8e-6]], $MachinePrecision]], N[(y$95$m * (-N[(z * t$95$m), $MachinePrecision])), $MachinePrecision], N[(N[(x * y$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t\_s \cdot \left(y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-127} \lor \neg \left(z \leq 5.8 \cdot 10^{-6}\right):\\
\;\;\;\;y\_m \cdot \left(-z \cdot t\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\_m\right) \cdot t\_m\\
\end{array}\right)
\end{array}
if z < -7.5000000000000004e-127 or 5.8000000000000004e-6 < z Initial program 93.7%
distribute-rgt-out--93.8%
associate-*l*89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in x around 0 75.9%
mul-1-neg75.9%
distribute-rgt-neg-out75.9%
Simplified75.9%
if -7.5000000000000004e-127 < z < 5.8000000000000004e-6Initial program 88.9%
distribute-rgt-out--88.9%
Simplified88.9%
Taylor expanded in x around inf 82.5%
*-commutative82.5%
Simplified82.5%
Final simplification78.6%
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s y_s x y_m z t_m)
:precision binary64
(*
t_s
(*
y_s
(if (or (<= z -7.5e-127) (not (<= z 4.8e-6)))
(* z (- (* y_m t_m)))
(* (* x y_m) t_m)))))y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
double tmp;
if ((z <= -7.5e-127) || !(z <= 4.8e-6)) {
tmp = z * -(y_m * t_m);
} else {
tmp = (x * y_m) * t_m;
}
return t_s * (y_s * tmp);
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if ((z <= (-7.5d-127)) .or. (.not. (z <= 4.8d-6))) then
tmp = z * -(y_m * t_m)
else
tmp = (x * y_m) * t_m
end if
code = t_s * (y_s * tmp)
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
double tmp;
if ((z <= -7.5e-127) || !(z <= 4.8e-6)) {
tmp = z * -(y_m * t_m);
} else {
tmp = (x * y_m) * t_m;
}
return t_s * (y_s * tmp);
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) t_m = math.fabs(t) t_s = math.copysign(1.0, t) [x, y_m, z, t_m] = sort([x, y_m, z, t_m]) def code(t_s, y_s, x, y_m, z, t_m): tmp = 0 if (z <= -7.5e-127) or not (z <= 4.8e-6): tmp = z * -(y_m * t_m) else: tmp = (x * y_m) * t_m return t_s * (y_s * tmp)
y_m = abs(y) y_s = copysign(1.0, y) t_m = abs(t) t_s = copysign(1.0, t) x, y_m, z, t_m = sort([x, y_m, z, t_m]) function code(t_s, y_s, x, y_m, z, t_m) tmp = 0.0 if ((z <= -7.5e-127) || !(z <= 4.8e-6)) tmp = Float64(z * Float64(-Float64(y_m * t_m))); else tmp = Float64(Float64(x * y_m) * t_m); end return Float64(t_s * Float64(y_s * tmp)) end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp_2 = code(t_s, y_s, x, y_m, z, t_m)
tmp = 0.0;
if ((z <= -7.5e-127) || ~((z <= 4.8e-6)))
tmp = z * -(y_m * t_m);
else
tmp = (x * y_m) * t_m;
end
tmp_2 = t_s * (y_s * tmp);
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
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_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * If[Or[LessEqual[z, -7.5e-127], N[Not[LessEqual[z, 4.8e-6]], $MachinePrecision]], N[(z * (-N[(y$95$m * t$95$m), $MachinePrecision])), $MachinePrecision], N[(N[(x * y$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t\_s \cdot \left(y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-127} \lor \neg \left(z \leq 4.8 \cdot 10^{-6}\right):\\
\;\;\;\;z \cdot \left(-y\_m \cdot t\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\_m\right) \cdot t\_m\\
\end{array}\right)
\end{array}
if z < -7.5000000000000004e-127 or 4.7999999999999998e-6 < z Initial program 93.7%
distribute-rgt-out--93.8%
associate-*l*89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in x around 0 77.4%
mul-1-neg77.4%
distribute-rgt-neg-in77.4%
distribute-rgt-neg-out77.4%
associate-*l*76.6%
Simplified76.6%
if -7.5000000000000004e-127 < z < 4.7999999999999998e-6Initial program 88.9%
distribute-rgt-out--88.9%
Simplified88.9%
Taylor expanded in x around inf 82.5%
*-commutative82.5%
Simplified82.5%
Final simplification79.0%
y_m = (fabs.f64 y)
y_s = (copysign.f64 1 y)
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
(FPCore (t_s y_s x y_m z t_m)
:precision binary64
(*
t_s
(*
y_s
(if (or (<= z -1.75e-122) (not (<= z 0.0026)))
(* (* y_m z) (- t_m))
(* (* x y_m) t_m)))))y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
double tmp;
if ((z <= -1.75e-122) || !(z <= 0.0026)) {
tmp = (y_m * z) * -t_m;
} else {
tmp = (x * y_m) * t_m;
}
return t_s * (y_s * tmp);
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if ((z <= (-1.75d-122)) .or. (.not. (z <= 0.0026d0))) then
tmp = (y_m * z) * -t_m
else
tmp = (x * y_m) * t_m
end if
code = t_s * (y_s * tmp)
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
double tmp;
if ((z <= -1.75e-122) || !(z <= 0.0026)) {
tmp = (y_m * z) * -t_m;
} else {
tmp = (x * y_m) * t_m;
}
return t_s * (y_s * tmp);
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) t_m = math.fabs(t) t_s = math.copysign(1.0, t) [x, y_m, z, t_m] = sort([x, y_m, z, t_m]) def code(t_s, y_s, x, y_m, z, t_m): tmp = 0 if (z <= -1.75e-122) or not (z <= 0.0026): tmp = (y_m * z) * -t_m else: tmp = (x * y_m) * t_m return t_s * (y_s * tmp)
y_m = abs(y) y_s = copysign(1.0, y) t_m = abs(t) t_s = copysign(1.0, t) x, y_m, z, t_m = sort([x, y_m, z, t_m]) function code(t_s, y_s, x, y_m, z, t_m) tmp = 0.0 if ((z <= -1.75e-122) || !(z <= 0.0026)) tmp = Float64(Float64(y_m * z) * Float64(-t_m)); else tmp = Float64(Float64(x * y_m) * t_m); end return Float64(t_s * Float64(y_s * tmp)) end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp_2 = code(t_s, y_s, x, y_m, z, t_m)
tmp = 0.0;
if ((z <= -1.75e-122) || ~((z <= 0.0026)))
tmp = (y_m * z) * -t_m;
else
tmp = (x * y_m) * t_m;
end
tmp_2 = t_s * (y_s * tmp);
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
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_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * If[Or[LessEqual[z, -1.75e-122], N[Not[LessEqual[z, 0.0026]], $MachinePrecision]], N[(N[(y$95$m * z), $MachinePrecision] * (-t$95$m)), $MachinePrecision], N[(N[(x * y$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t\_s \cdot \left(y\_s \cdot \begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-122} \lor \neg \left(z \leq 0.0026\right):\\
\;\;\;\;\left(y\_m \cdot z\right) \cdot \left(-t\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\_m\right) \cdot t\_m\\
\end{array}\right)
\end{array}
if z < -1.7500000000000001e-122 or 0.0025999999999999999 < z Initial program 93.6%
distribute-rgt-out--93.7%
Simplified93.7%
Taylor expanded in x around 0 77.6%
associate-*r*77.6%
*-commutative77.6%
mul-1-neg77.6%
Simplified77.6%
if -1.7500000000000001e-122 < z < 0.0025999999999999999Initial program 89.2%
distribute-rgt-out--89.2%
Simplified89.2%
Taylor expanded in x around inf 82.1%
*-commutative82.1%
Simplified82.1%
Final simplification79.5%
y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function. (FPCore (t_s y_s x y_m z t_m) :precision binary64 (* t_s (* y_s (if (<= t_m 9.5e-23) (* y_m (* t_m (- x z))) (* (- x z) (* y_m t_m))))))
y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
double tmp;
if (t_m <= 9.5e-23) {
tmp = y_m * (t_m * (x - z));
} else {
tmp = (x - z) * (y_m * t_m);
}
return t_s * (y_s * tmp);
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8), intent (in) :: t_m
real(8) :: tmp
if (t_m <= 9.5d-23) then
tmp = y_m * (t_m * (x - z))
else
tmp = (x - z) * (y_m * t_m)
end if
code = t_s * (y_s * tmp)
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
double tmp;
if (t_m <= 9.5e-23) {
tmp = y_m * (t_m * (x - z));
} else {
tmp = (x - z) * (y_m * t_m);
}
return t_s * (y_s * tmp);
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) t_m = math.fabs(t) t_s = math.copysign(1.0, t) [x, y_m, z, t_m] = sort([x, y_m, z, t_m]) def code(t_s, y_s, x, y_m, z, t_m): tmp = 0 if t_m <= 9.5e-23: tmp = y_m * (t_m * (x - z)) else: tmp = (x - z) * (y_m * t_m) return t_s * (y_s * tmp)
y_m = abs(y) y_s = copysign(1.0, y) t_m = abs(t) t_s = copysign(1.0, t) x, y_m, z, t_m = sort([x, y_m, z, t_m]) function code(t_s, y_s, x, y_m, z, t_m) tmp = 0.0 if (t_m <= 9.5e-23) tmp = Float64(y_m * Float64(t_m * Float64(x - z))); else tmp = Float64(Float64(x - z) * Float64(y_m * t_m)); end return Float64(t_s * Float64(y_s * tmp)) end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp_2 = code(t_s, y_s, x, y_m, z, t_m)
tmp = 0.0;
if (t_m <= 9.5e-23)
tmp = y_m * (t_m * (x - z));
else
tmp = (x - z) * (y_m * t_m);
end
tmp_2 = t_s * (y_s * tmp);
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
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_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * If[LessEqual[t$95$m, 9.5e-23], N[(y$95$m * N[(t$95$m * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - z), $MachinePrecision] * N[(y$95$m * t$95$m), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t\_s \cdot \left(y\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 9.5 \cdot 10^{-23}:\\
\;\;\;\;y\_m \cdot \left(t\_m \cdot \left(x - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - z\right) \cdot \left(y\_m \cdot t\_m\right)\\
\end{array}\right)
\end{array}
if t < 9.50000000000000058e-23Initial program 91.0%
distribute-rgt-out--91.1%
associate-*l*90.7%
*-commutative90.7%
Simplified90.7%
if 9.50000000000000058e-23 < t Initial program 94.3%
*-commutative94.3%
distribute-rgt-out--94.3%
associate-*r*98.3%
*-commutative98.3%
Simplified98.3%
Final simplification92.5%
y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function. (FPCore (t_s y_s x y_m z t_m) :precision binary64 (* t_s (* y_s (* y_m (* x t_m)))))
y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
return t_s * (y_s * (y_m * (x * t_m)));
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = t_s * (y_s * (y_m * (x * t_m)))
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
return t_s * (y_s * (y_m * (x * t_m)));
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) t_m = math.fabs(t) t_s = math.copysign(1.0, t) [x, y_m, z, t_m] = sort([x, y_m, z, t_m]) def code(t_s, y_s, x, y_m, z, t_m): return t_s * (y_s * (y_m * (x * t_m)))
y_m = abs(y) y_s = copysign(1.0, y) t_m = abs(t) t_s = copysign(1.0, t) x, y_m, z, t_m = sort([x, y_m, z, t_m]) function code(t_s, y_s, x, y_m, z, t_m) return Float64(t_s * Float64(y_s * Float64(y_m * Float64(x * t_m)))) end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp = code(t_s, y_s, x, y_m, z, t_m)
tmp = t_s * (y_s * (y_m * (x * t_m)));
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
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_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * N[(y$95$m * N[(x * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t\_s \cdot \left(y\_s \cdot \left(y\_m \cdot \left(x \cdot t\_m\right)\right)\right)
\end{array}
Initial program 91.8%
distribute-rgt-out--91.9%
associate-*l*89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in x around inf 51.2%
associate-*r*47.9%
*-commutative47.9%
Simplified47.9%
Final simplification47.9%
y_m = (fabs.f64 y) y_s = (copysign.f64 1 y) t_m = (fabs.f64 t) t_s = (copysign.f64 1 t) NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function. (FPCore (t_s y_s x y_m z t_m) :precision binary64 (* t_s (* y_s (* (* x y_m) t_m))))
y_m = fabs(y);
y_s = copysign(1.0, y);
t_m = fabs(t);
t_s = copysign(1.0, t);
assert(x < y_m && y_m < z && z < t_m);
double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
return t_s * (y_s * ((x * y_m) * t_m));
}
y_m = abs(y)
y_s = copysign(1.0d0, y)
t_m = abs(t)
t_s = copysign(1.0d0, t)
NOTE: x, y_m, z, and t_m should be sorted in increasing order before calling this function.
real(8) function code(t_s, y_s, x, y_m, z, t_m)
real(8), intent (in) :: t_s
real(8), intent (in) :: y_s
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8), intent (in) :: t_m
code = t_s * (y_s * ((x * y_m) * t_m))
end function
y_m = Math.abs(y);
y_s = Math.copySign(1.0, y);
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
assert x < y_m && y_m < z && z < t_m;
public static double code(double t_s, double y_s, double x, double y_m, double z, double t_m) {
return t_s * (y_s * ((x * y_m) * t_m));
}
y_m = math.fabs(y) y_s = math.copysign(1.0, y) t_m = math.fabs(t) t_s = math.copysign(1.0, t) [x, y_m, z, t_m] = sort([x, y_m, z, t_m]) def code(t_s, y_s, x, y_m, z, t_m): return t_s * (y_s * ((x * y_m) * t_m))
y_m = abs(y) y_s = copysign(1.0, y) t_m = abs(t) t_s = copysign(1.0, t) x, y_m, z, t_m = sort([x, y_m, z, t_m]) function code(t_s, y_s, x, y_m, z, t_m) return Float64(t_s * Float64(y_s * Float64(Float64(x * y_m) * t_m))) end
y_m = abs(y);
y_s = sign(y) * abs(1.0);
t_m = abs(t);
t_s = sign(t) * abs(1.0);
x, y_m, z, t_m = num2cell(sort([x, y_m, z, t_m])){:}
function tmp = code(t_s, y_s, x, y_m, z, t_m)
tmp = t_s * (y_s * ((x * y_m) * t_m));
end
y_m = N[Abs[y], $MachinePrecision]
y_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[y]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
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_m, z, and t_m should be sorted in increasing order before calling this function.
code[t$95$s_, y$95$s_, x_, y$95$m_, z_, t$95$m_] := N[(t$95$s * N[(y$95$s * N[(N[(x * y$95$m), $MachinePrecision] * t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
y_s = \mathsf{copysign}\left(1, y\right)
\\
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)
\\
[x, y_m, z, t_m] = \mathsf{sort}([x, y_m, z, t_m])\\
\\
t\_s \cdot \left(y\_s \cdot \left(\left(x \cdot y\_m\right) \cdot t\_m\right)\right)
\end{array}
Initial program 91.8%
distribute-rgt-out--91.9%
Simplified91.9%
Taylor expanded in x around inf 51.2%
*-commutative51.2%
Simplified51.2%
Final simplification51.2%
(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 2024040
(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))