
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
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) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
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) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
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) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))))
(if (<= z -2500000.0)
(* x z)
(if (<= z -2.4e-215)
t_1
(if (<= z 5.8e-289)
(* y t)
(if (<= z 2.15e-67)
t_1
(if (<= z 1.8e-51) (* y t) (if (<= z 4.1e+55) t_1 (* x z)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double tmp;
if (z <= -2500000.0) {
tmp = x * z;
} else if (z <= -2.4e-215) {
tmp = t_1;
} else if (z <= 5.8e-289) {
tmp = y * t;
} else if (z <= 2.15e-67) {
tmp = t_1;
} else if (z <= 1.8e-51) {
tmp = y * t;
} else if (z <= 4.1e+55) {
tmp = t_1;
} else {
tmp = x * z;
}
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) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - y)
if (z <= (-2500000.0d0)) then
tmp = x * z
else if (z <= (-2.4d-215)) then
tmp = t_1
else if (z <= 5.8d-289) then
tmp = y * t
else if (z <= 2.15d-67) then
tmp = t_1
else if (z <= 1.8d-51) then
tmp = y * t
else if (z <= 4.1d+55) then
tmp = t_1
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double tmp;
if (z <= -2500000.0) {
tmp = x * z;
} else if (z <= -2.4e-215) {
tmp = t_1;
} else if (z <= 5.8e-289) {
tmp = y * t;
} else if (z <= 2.15e-67) {
tmp = t_1;
} else if (z <= 1.8e-51) {
tmp = y * t;
} else if (z <= 4.1e+55) {
tmp = t_1;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) tmp = 0 if z <= -2500000.0: tmp = x * z elif z <= -2.4e-215: tmp = t_1 elif z <= 5.8e-289: tmp = y * t elif z <= 2.15e-67: tmp = t_1 elif z <= 1.8e-51: tmp = y * t elif z <= 4.1e+55: tmp = t_1 else: tmp = x * z return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (z <= -2500000.0) tmp = Float64(x * z); elseif (z <= -2.4e-215) tmp = t_1; elseif (z <= 5.8e-289) tmp = Float64(y * t); elseif (z <= 2.15e-67) tmp = t_1; elseif (z <= 1.8e-51) tmp = Float64(y * t); elseif (z <= 4.1e+55) tmp = t_1; else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); tmp = 0.0; if (z <= -2500000.0) tmp = x * z; elseif (z <= -2.4e-215) tmp = t_1; elseif (z <= 5.8e-289) tmp = y * t; elseif (z <= 2.15e-67) tmp = t_1; elseif (z <= 1.8e-51) tmp = y * t; elseif (z <= 4.1e+55) tmp = t_1; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2500000.0], N[(x * z), $MachinePrecision], If[LessEqual[z, -2.4e-215], t$95$1, If[LessEqual[z, 5.8e-289], N[(y * t), $MachinePrecision], If[LessEqual[z, 2.15e-67], t$95$1, If[LessEqual[z, 1.8e-51], N[(y * t), $MachinePrecision], If[LessEqual[z, 4.1e+55], t$95$1, N[(x * z), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -2500000:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-289}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-51}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -2.5e6 or 4.09999999999999981e55 < z Initial program 100.0%
Taylor expanded in t around 0 62.5%
mul-1-neg62.5%
distribute-rgt-neg-in62.5%
sub-neg62.5%
+-commutative62.5%
distribute-neg-in62.5%
remove-double-neg62.5%
sub-neg62.5%
Simplified62.5%
Taylor expanded in z around inf 51.2%
if -2.5e6 < z < -2.4000000000000001e-215 or 5.80000000000000012e-289 < z < 2.15000000000000013e-67 or 1.8e-51 < z < 4.09999999999999981e55Initial program 100.0%
Taylor expanded in t around 0 64.6%
mul-1-neg64.6%
distribute-rgt-neg-in64.6%
sub-neg64.6%
+-commutative64.6%
distribute-neg-in64.6%
remove-double-neg64.6%
sub-neg64.6%
Simplified64.6%
Taylor expanded in z around 0 64.4%
mul-1-neg64.4%
*-rgt-identity64.4%
distribute-rgt-neg-in64.4%
mul-1-neg64.4%
distribute-lft-in64.4%
mul-1-neg64.4%
unsub-neg64.4%
Simplified64.4%
if -2.4000000000000001e-215 < z < 5.80000000000000012e-289 or 2.15000000000000013e-67 < z < 1.8e-51Initial program 99.9%
Taylor expanded in t around inf 93.4%
Taylor expanded in y around -inf 87.1%
mul-1-neg87.1%
*-commutative87.1%
distribute-rgt-neg-in87.1%
neg-mul-187.1%
+-commutative87.1%
associate-/l*87.1%
neg-mul-187.1%
*-commutative87.1%
distribute-lft-out87.1%
Simplified87.1%
Taylor expanded in x around 0 93.5%
mul-1-neg93.5%
sub-neg93.5%
metadata-eval93.5%
associate-*r*93.4%
distribute-lft-neg-in93.4%
cancel-sign-sub-inv93.4%
+-commutative93.4%
Simplified93.4%
Taylor expanded in y around inf 73.6%
Final simplification59.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* x z))) (t_2 (+ x (* y t))) (t_3 (- x (* z t))))
(if (<= y -2.7e-70)
t_2
(if (<= y -4e-257)
t_3
(if (<= y 2.85e-266)
t_1
(if (<= y 1.3e-112)
t_3
(if (<= y 7.8e+18) t_1 (if (<= y 3.8e+119) t_2 (* x (- y))))))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (x * z);
double t_2 = x + (y * t);
double t_3 = x - (z * t);
double tmp;
if (y <= -2.7e-70) {
tmp = t_2;
} else if (y <= -4e-257) {
tmp = t_3;
} else if (y <= 2.85e-266) {
tmp = t_1;
} else if (y <= 1.3e-112) {
tmp = t_3;
} else if (y <= 7.8e+18) {
tmp = t_1;
} else if (y <= 3.8e+119) {
tmp = t_2;
} else {
tmp = x * -y;
}
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x + (x * z)
t_2 = x + (y * t)
t_3 = x - (z * t)
if (y <= (-2.7d-70)) then
tmp = t_2
else if (y <= (-4d-257)) then
tmp = t_3
else if (y <= 2.85d-266) then
tmp = t_1
else if (y <= 1.3d-112) then
tmp = t_3
else if (y <= 7.8d+18) then
tmp = t_1
else if (y <= 3.8d+119) then
tmp = t_2
else
tmp = x * -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + (x * z);
double t_2 = x + (y * t);
double t_3 = x - (z * t);
double tmp;
if (y <= -2.7e-70) {
tmp = t_2;
} else if (y <= -4e-257) {
tmp = t_3;
} else if (y <= 2.85e-266) {
tmp = t_1;
} else if (y <= 1.3e-112) {
tmp = t_3;
} else if (y <= 7.8e+18) {
tmp = t_1;
} else if (y <= 3.8e+119) {
tmp = t_2;
} else {
tmp = x * -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (x * z) t_2 = x + (y * t) t_3 = x - (z * t) tmp = 0 if y <= -2.7e-70: tmp = t_2 elif y <= -4e-257: tmp = t_3 elif y <= 2.85e-266: tmp = t_1 elif y <= 1.3e-112: tmp = t_3 elif y <= 7.8e+18: tmp = t_1 elif y <= 3.8e+119: tmp = t_2 else: tmp = x * -y return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(x * z)) t_2 = Float64(x + Float64(y * t)) t_3 = Float64(x - Float64(z * t)) tmp = 0.0 if (y <= -2.7e-70) tmp = t_2; elseif (y <= -4e-257) tmp = t_3; elseif (y <= 2.85e-266) tmp = t_1; elseif (y <= 1.3e-112) tmp = t_3; elseif (y <= 7.8e+18) tmp = t_1; elseif (y <= 3.8e+119) tmp = t_2; else tmp = Float64(x * Float64(-y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (x * z); t_2 = x + (y * t); t_3 = x - (z * t); tmp = 0.0; if (y <= -2.7e-70) tmp = t_2; elseif (y <= -4e-257) tmp = t_3; elseif (y <= 2.85e-266) tmp = t_1; elseif (y <= 1.3e-112) tmp = t_3; elseif (y <= 7.8e+18) tmp = t_1; elseif (y <= 3.8e+119) tmp = t_2; else tmp = x * -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e-70], t$95$2, If[LessEqual[y, -4e-257], t$95$3, If[LessEqual[y, 2.85e-266], t$95$1, If[LessEqual[y, 1.3e-112], t$95$3, If[LessEqual[y, 7.8e+18], t$95$1, If[LessEqual[y, 3.8e+119], t$95$2, N[(x * (-y)), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + x \cdot z\\
t_2 := x + y \cdot t\\
t_3 := x - z \cdot t\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{-70}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -4 \cdot 10^{-257}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 2.85 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-112}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+119}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\end{array}
\end{array}
if y < -2.7000000000000001e-70 or 7.8e18 < y < 3.7999999999999999e119Initial program 100.0%
Taylor expanded in t around inf 57.9%
Taylor expanded in y around inf 52.4%
*-commutative52.4%
Simplified52.4%
if -2.7000000000000001e-70 < y < -3.9999999999999999e-257 or 2.8500000000000001e-266 < y < 1.29999999999999996e-112Initial program 100.0%
Taylor expanded in t around inf 83.0%
Taylor expanded in y around 0 78.7%
mul-1-neg78.7%
unsub-neg78.7%
Simplified78.7%
if -3.9999999999999999e-257 < y < 2.8500000000000001e-266 or 1.29999999999999996e-112 < y < 7.8e18Initial program 99.9%
Taylor expanded in t around 0 72.8%
mul-1-neg72.8%
distribute-rgt-neg-in72.8%
sub-neg72.8%
+-commutative72.8%
distribute-neg-in72.8%
remove-double-neg72.8%
sub-neg72.8%
Simplified72.8%
Taylor expanded in y around 0 72.8%
if 3.7999999999999999e119 < y Initial program 100.0%
Taylor expanded in t around 0 64.7%
mul-1-neg64.7%
distribute-rgt-neg-in64.7%
sub-neg64.7%
+-commutative64.7%
distribute-neg-in64.7%
remove-double-neg64.7%
sub-neg64.7%
Simplified64.7%
Taylor expanded in y around inf 59.6%
mul-1-neg59.6%
distribute-lft-neg-out59.6%
*-commutative59.6%
Simplified59.6%
Final simplification64.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- y))))
(if (<= y -1.6e+58)
t_1
(if (<= y -2.2e-70)
(* y t)
(if (<= y 2.1e-234)
x
(if (<= y 1.25e-115)
(* z (- t))
(if (<= y 0.000185) (* x z) (if (<= y 3.05e+119) (* y t) t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * -y;
double tmp;
if (y <= -1.6e+58) {
tmp = t_1;
} else if (y <= -2.2e-70) {
tmp = y * t;
} else if (y <= 2.1e-234) {
tmp = x;
} else if (y <= 1.25e-115) {
tmp = z * -t;
} else if (y <= 0.000185) {
tmp = x * z;
} else if (y <= 3.05e+119) {
tmp = y * t;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = x * -y
if (y <= (-1.6d+58)) then
tmp = t_1
else if (y <= (-2.2d-70)) then
tmp = y * t
else if (y <= 2.1d-234) then
tmp = x
else if (y <= 1.25d-115) then
tmp = z * -t
else if (y <= 0.000185d0) then
tmp = x * z
else if (y <= 3.05d+119) then
tmp = y * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * -y;
double tmp;
if (y <= -1.6e+58) {
tmp = t_1;
} else if (y <= -2.2e-70) {
tmp = y * t;
} else if (y <= 2.1e-234) {
tmp = x;
} else if (y <= 1.25e-115) {
tmp = z * -t;
} else if (y <= 0.000185) {
tmp = x * z;
} else if (y <= 3.05e+119) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * -y tmp = 0 if y <= -1.6e+58: tmp = t_1 elif y <= -2.2e-70: tmp = y * t elif y <= 2.1e-234: tmp = x elif y <= 1.25e-115: tmp = z * -t elif y <= 0.000185: tmp = x * z elif y <= 3.05e+119: tmp = y * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(-y)) tmp = 0.0 if (y <= -1.6e+58) tmp = t_1; elseif (y <= -2.2e-70) tmp = Float64(y * t); elseif (y <= 2.1e-234) tmp = x; elseif (y <= 1.25e-115) tmp = Float64(z * Float64(-t)); elseif (y <= 0.000185) tmp = Float64(x * z); elseif (y <= 3.05e+119) tmp = Float64(y * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * -y; tmp = 0.0; if (y <= -1.6e+58) tmp = t_1; elseif (y <= -2.2e-70) tmp = y * t; elseif (y <= 2.1e-234) tmp = x; elseif (y <= 1.25e-115) tmp = z * -t; elseif (y <= 0.000185) tmp = x * z; elseif (y <= 3.05e+119) tmp = y * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[y, -1.6e+58], t$95$1, If[LessEqual[y, -2.2e-70], N[(y * t), $MachinePrecision], If[LessEqual[y, 2.1e-234], x, If[LessEqual[y, 1.25e-115], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 0.000185], N[(x * z), $MachinePrecision], If[LessEqual[y, 3.05e+119], N[(y * t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(-y\right)\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.2 \cdot 10^{-70}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-234}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-115}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 0.000185:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;y \leq 3.05 \cdot 10^{+119}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.60000000000000008e58 or 3.05e119 < y Initial program 100.0%
Taylor expanded in t around 0 62.9%
mul-1-neg62.9%
distribute-rgt-neg-in62.9%
sub-neg62.9%
+-commutative62.9%
distribute-neg-in62.9%
remove-double-neg62.9%
sub-neg62.9%
Simplified62.9%
Taylor expanded in y around inf 55.2%
mul-1-neg55.2%
distribute-lft-neg-out55.2%
*-commutative55.2%
Simplified55.2%
if -1.60000000000000008e58 < y < -2.1999999999999999e-70 or 1.85e-4 < y < 3.05e119Initial program 100.0%
Taylor expanded in t around inf 65.5%
Taylor expanded in y around -inf 65.5%
mul-1-neg65.5%
*-commutative65.5%
distribute-rgt-neg-in65.5%
neg-mul-165.5%
+-commutative65.5%
associate-/l*65.5%
neg-mul-165.5%
*-commutative65.5%
distribute-lft-out65.5%
Simplified65.5%
Taylor expanded in x around 0 65.5%
mul-1-neg65.5%
sub-neg65.5%
metadata-eval65.5%
associate-*r*65.5%
distribute-lft-neg-in65.5%
cancel-sign-sub-inv65.5%
+-commutative65.5%
Simplified65.5%
Taylor expanded in y around inf 51.9%
if -2.1999999999999999e-70 < y < 2.09999999999999991e-234Initial program 99.9%
Taylor expanded in t around inf 77.2%
Taylor expanded in x around inf 45.3%
if 2.09999999999999991e-234 < y < 1.2500000000000001e-115Initial program 100.0%
Taylor expanded in t around inf 79.5%
Taylor expanded in y around -inf 76.7%
mul-1-neg76.7%
*-commutative76.7%
distribute-rgt-neg-in76.7%
neg-mul-176.7%
+-commutative76.7%
associate-/l*76.4%
neg-mul-176.4%
*-commutative76.4%
distribute-lft-out76.4%
Simplified76.4%
Taylor expanded in x around 0 79.3%
mul-1-neg79.3%
sub-neg79.3%
metadata-eval79.3%
associate-*r*76.4%
distribute-lft-neg-in76.4%
cancel-sign-sub-inv76.4%
+-commutative76.4%
Simplified76.4%
Taylor expanded in z around inf 53.4%
associate-*r*53.4%
mul-1-neg53.4%
Simplified53.4%
if 1.2500000000000001e-115 < y < 1.85e-4Initial program 99.9%
Taylor expanded in t around 0 68.5%
mul-1-neg68.5%
distribute-rgt-neg-in68.5%
sub-neg68.5%
+-commutative68.5%
distribute-neg-in68.5%
remove-double-neg68.5%
sub-neg68.5%
Simplified68.5%
Taylor expanded in z around inf 47.6%
Final simplification51.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* x z))) (t_2 (* x (- y))))
(if (<= y -9e+58)
t_2
(if (<= y -4.2e-15)
(* y t)
(if (<= y 2.4e-187)
t_1
(if (<= y 6e-164)
(* z (- t))
(if (<= y 3.1e+18) t_1 (if (<= y 3.05e+119) (* y t) t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (x * z);
double t_2 = x * -y;
double tmp;
if (y <= -9e+58) {
tmp = t_2;
} else if (y <= -4.2e-15) {
tmp = y * t;
} else if (y <= 2.4e-187) {
tmp = t_1;
} else if (y <= 6e-164) {
tmp = z * -t;
} else if (y <= 3.1e+18) {
tmp = t_1;
} else if (y <= 3.05e+119) {
tmp = y * t;
} else {
tmp = t_2;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (x * z)
t_2 = x * -y
if (y <= (-9d+58)) then
tmp = t_2
else if (y <= (-4.2d-15)) then
tmp = y * t
else if (y <= 2.4d-187) then
tmp = t_1
else if (y <= 6d-164) then
tmp = z * -t
else if (y <= 3.1d+18) then
tmp = t_1
else if (y <= 3.05d+119) then
tmp = y * t
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + (x * z);
double t_2 = x * -y;
double tmp;
if (y <= -9e+58) {
tmp = t_2;
} else if (y <= -4.2e-15) {
tmp = y * t;
} else if (y <= 2.4e-187) {
tmp = t_1;
} else if (y <= 6e-164) {
tmp = z * -t;
} else if (y <= 3.1e+18) {
tmp = t_1;
} else if (y <= 3.05e+119) {
tmp = y * t;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (x * z) t_2 = x * -y tmp = 0 if y <= -9e+58: tmp = t_2 elif y <= -4.2e-15: tmp = y * t elif y <= 2.4e-187: tmp = t_1 elif y <= 6e-164: tmp = z * -t elif y <= 3.1e+18: tmp = t_1 elif y <= 3.05e+119: tmp = y * t else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(x * z)) t_2 = Float64(x * Float64(-y)) tmp = 0.0 if (y <= -9e+58) tmp = t_2; elseif (y <= -4.2e-15) tmp = Float64(y * t); elseif (y <= 2.4e-187) tmp = t_1; elseif (y <= 6e-164) tmp = Float64(z * Float64(-t)); elseif (y <= 3.1e+18) tmp = t_1; elseif (y <= 3.05e+119) tmp = Float64(y * t); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (x * z); t_2 = x * -y; tmp = 0.0; if (y <= -9e+58) tmp = t_2; elseif (y <= -4.2e-15) tmp = y * t; elseif (y <= 2.4e-187) tmp = t_1; elseif (y <= 6e-164) tmp = z * -t; elseif (y <= 3.1e+18) tmp = t_1; elseif (y <= 3.05e+119) tmp = y * t; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[y, -9e+58], t$95$2, If[LessEqual[y, -4.2e-15], N[(y * t), $MachinePrecision], If[LessEqual[y, 2.4e-187], t$95$1, If[LessEqual[y, 6e-164], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 3.1e+18], t$95$1, If[LessEqual[y, 3.05e+119], N[(y * t), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + x \cdot z\\
t_2 := x \cdot \left(-y\right)\\
\mathbf{if}\;y \leq -9 \cdot 10^{+58}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{-15}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-164}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.05 \cdot 10^{+119}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -8.9999999999999996e58 or 3.05e119 < y Initial program 100.0%
Taylor expanded in t around 0 62.9%
mul-1-neg62.9%
distribute-rgt-neg-in62.9%
sub-neg62.9%
+-commutative62.9%
distribute-neg-in62.9%
remove-double-neg62.9%
sub-neg62.9%
Simplified62.9%
Taylor expanded in y around inf 55.2%
mul-1-neg55.2%
distribute-lft-neg-out55.2%
*-commutative55.2%
Simplified55.2%
if -8.9999999999999996e58 < y < -4.19999999999999962e-15 or 3.1e18 < y < 3.05e119Initial program 100.0%
Taylor expanded in t around inf 63.8%
Taylor expanded in y around -inf 63.8%
mul-1-neg63.8%
*-commutative63.8%
distribute-rgt-neg-in63.8%
neg-mul-163.8%
+-commutative63.8%
associate-/l*63.8%
neg-mul-163.8%
*-commutative63.8%
distribute-lft-out63.8%
Simplified63.8%
Taylor expanded in x around 0 63.8%
mul-1-neg63.8%
sub-neg63.8%
metadata-eval63.8%
associate-*r*63.8%
distribute-lft-neg-in63.8%
cancel-sign-sub-inv63.8%
+-commutative63.8%
Simplified63.8%
Taylor expanded in y around inf 60.1%
if -4.19999999999999962e-15 < y < 2.40000000000000013e-187 or 6.0000000000000002e-164 < y < 3.1e18Initial program 100.0%
Taylor expanded in t around 0 64.0%
mul-1-neg64.0%
distribute-rgt-neg-in64.0%
sub-neg64.0%
+-commutative64.0%
distribute-neg-in64.0%
remove-double-neg64.0%
sub-neg64.0%
Simplified64.0%
Taylor expanded in y around 0 64.0%
if 2.40000000000000013e-187 < y < 6.0000000000000002e-164Initial program 100.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in y around -inf 99.8%
mul-1-neg99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
neg-mul-199.8%
+-commutative99.8%
associate-/l*99.8%
neg-mul-199.8%
*-commutative99.8%
distribute-lft-out99.8%
Simplified99.8%
Taylor expanded in x around 0 99.6%
mul-1-neg99.6%
sub-neg99.6%
metadata-eval99.6%
associate-*r*88.2%
distribute-lft-neg-in88.2%
cancel-sign-sub-inv88.2%
+-commutative88.2%
Simplified88.2%
Taylor expanded in z around inf 87.9%
associate-*r*87.9%
mul-1-neg87.9%
Simplified87.9%
Final simplification61.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* x z))) (t_2 (+ x (* y t))) (t_3 (* x (- 1.0 y))))
(if (<= t -1.65e+40)
t_2
(if (<= t -2.3e-89)
t_3
(if (<= t -5.2e-278)
t_1
(if (<= t 1.2e-66) t_3 (if (<= t 1.85e+67) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (x * z);
double t_2 = x + (y * t);
double t_3 = x * (1.0 - y);
double tmp;
if (t <= -1.65e+40) {
tmp = t_2;
} else if (t <= -2.3e-89) {
tmp = t_3;
} else if (t <= -5.2e-278) {
tmp = t_1;
} else if (t <= 1.2e-66) {
tmp = t_3;
} else if (t <= 1.85e+67) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x + (x * z)
t_2 = x + (y * t)
t_3 = x * (1.0d0 - y)
if (t <= (-1.65d+40)) then
tmp = t_2
else if (t <= (-2.3d-89)) then
tmp = t_3
else if (t <= (-5.2d-278)) then
tmp = t_1
else if (t <= 1.2d-66) then
tmp = t_3
else if (t <= 1.85d+67) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x + (x * z);
double t_2 = x + (y * t);
double t_3 = x * (1.0 - y);
double tmp;
if (t <= -1.65e+40) {
tmp = t_2;
} else if (t <= -2.3e-89) {
tmp = t_3;
} else if (t <= -5.2e-278) {
tmp = t_1;
} else if (t <= 1.2e-66) {
tmp = t_3;
} else if (t <= 1.85e+67) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (x * z) t_2 = x + (y * t) t_3 = x * (1.0 - y) tmp = 0 if t <= -1.65e+40: tmp = t_2 elif t <= -2.3e-89: tmp = t_3 elif t <= -5.2e-278: tmp = t_1 elif t <= 1.2e-66: tmp = t_3 elif t <= 1.85e+67: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(x * z)) t_2 = Float64(x + Float64(y * t)) t_3 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (t <= -1.65e+40) tmp = t_2; elseif (t <= -2.3e-89) tmp = t_3; elseif (t <= -5.2e-278) tmp = t_1; elseif (t <= 1.2e-66) tmp = t_3; elseif (t <= 1.85e+67) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (x * z); t_2 = x + (y * t); t_3 = x * (1.0 - y); tmp = 0.0; if (t <= -1.65e+40) tmp = t_2; elseif (t <= -2.3e-89) tmp = t_3; elseif (t <= -5.2e-278) tmp = t_1; elseif (t <= 1.2e-66) tmp = t_3; elseif (t <= 1.85e+67) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.65e+40], t$95$2, If[LessEqual[t, -2.3e-89], t$95$3, If[LessEqual[t, -5.2e-278], t$95$1, If[LessEqual[t, 1.2e-66], t$95$3, If[LessEqual[t, 1.85e+67], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + x \cdot z\\
t_2 := x + y \cdot t\\
t_3 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;t \leq -1.65 \cdot 10^{+40}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2.3 \cdot 10^{-89}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq -5.2 \cdot 10^{-278}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-66}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -1.6499999999999999e40 or 1.8499999999999999e67 < t Initial program 100.0%
Taylor expanded in t around inf 89.8%
Taylor expanded in y around inf 58.4%
*-commutative58.4%
Simplified58.4%
if -1.6499999999999999e40 < t < -2.3e-89 or -5.1999999999999997e-278 < t < 1.20000000000000013e-66Initial program 100.0%
Taylor expanded in t around 0 82.1%
mul-1-neg82.1%
distribute-rgt-neg-in82.1%
sub-neg82.1%
+-commutative82.1%
distribute-neg-in82.1%
remove-double-neg82.1%
sub-neg82.1%
Simplified82.1%
Taylor expanded in z around 0 68.0%
mul-1-neg68.0%
*-rgt-identity68.0%
distribute-rgt-neg-in68.0%
mul-1-neg68.0%
distribute-lft-in68.0%
mul-1-neg68.0%
unsub-neg68.0%
Simplified68.0%
if -2.3e-89 < t < -5.1999999999999997e-278 or 1.20000000000000013e-66 < t < 1.8499999999999999e67Initial program 100.0%
Taylor expanded in t around 0 81.2%
mul-1-neg81.2%
distribute-rgt-neg-in81.2%
sub-neg81.2%
+-commutative81.2%
distribute-neg-in81.2%
remove-double-neg81.2%
sub-neg81.2%
Simplified81.2%
Taylor expanded in y around 0 65.3%
Final simplification63.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- y))))
(if (<= y -4.8e+57)
t_1
(if (<= y -2.65e-70)
(* y t)
(if (<= y 3e-196)
x
(if (<= y 0.007) (* x z) (if (<= y 5.1e+119) (* y t) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * -y;
double tmp;
if (y <= -4.8e+57) {
tmp = t_1;
} else if (y <= -2.65e-70) {
tmp = y * t;
} else if (y <= 3e-196) {
tmp = x;
} else if (y <= 0.007) {
tmp = x * z;
} else if (y <= 5.1e+119) {
tmp = y * t;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = x * -y
if (y <= (-4.8d+57)) then
tmp = t_1
else if (y <= (-2.65d-70)) then
tmp = y * t
else if (y <= 3d-196) then
tmp = x
else if (y <= 0.007d0) then
tmp = x * z
else if (y <= 5.1d+119) then
tmp = y * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * -y;
double tmp;
if (y <= -4.8e+57) {
tmp = t_1;
} else if (y <= -2.65e-70) {
tmp = y * t;
} else if (y <= 3e-196) {
tmp = x;
} else if (y <= 0.007) {
tmp = x * z;
} else if (y <= 5.1e+119) {
tmp = y * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * -y tmp = 0 if y <= -4.8e+57: tmp = t_1 elif y <= -2.65e-70: tmp = y * t elif y <= 3e-196: tmp = x elif y <= 0.007: tmp = x * z elif y <= 5.1e+119: tmp = y * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(-y)) tmp = 0.0 if (y <= -4.8e+57) tmp = t_1; elseif (y <= -2.65e-70) tmp = Float64(y * t); elseif (y <= 3e-196) tmp = x; elseif (y <= 0.007) tmp = Float64(x * z); elseif (y <= 5.1e+119) tmp = Float64(y * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * -y; tmp = 0.0; if (y <= -4.8e+57) tmp = t_1; elseif (y <= -2.65e-70) tmp = y * t; elseif (y <= 3e-196) tmp = x; elseif (y <= 0.007) tmp = x * z; elseif (y <= 5.1e+119) tmp = y * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[y, -4.8e+57], t$95$1, If[LessEqual[y, -2.65e-70], N[(y * t), $MachinePrecision], If[LessEqual[y, 3e-196], x, If[LessEqual[y, 0.007], N[(x * z), $MachinePrecision], If[LessEqual[y, 5.1e+119], N[(y * t), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(-y\right)\\
\mathbf{if}\;y \leq -4.8 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.65 \cdot 10^{-70}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-196}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 0.007:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{+119}:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.80000000000000009e57 or 5.09999999999999984e119 < y Initial program 100.0%
Taylor expanded in t around 0 62.9%
mul-1-neg62.9%
distribute-rgt-neg-in62.9%
sub-neg62.9%
+-commutative62.9%
distribute-neg-in62.9%
remove-double-neg62.9%
sub-neg62.9%
Simplified62.9%
Taylor expanded in y around inf 55.2%
mul-1-neg55.2%
distribute-lft-neg-out55.2%
*-commutative55.2%
Simplified55.2%
if -4.80000000000000009e57 < y < -2.64999999999999992e-70 or 0.00700000000000000015 < y < 5.09999999999999984e119Initial program 100.0%
Taylor expanded in t around inf 65.5%
Taylor expanded in y around -inf 65.5%
mul-1-neg65.5%
*-commutative65.5%
distribute-rgt-neg-in65.5%
neg-mul-165.5%
+-commutative65.5%
associate-/l*65.5%
neg-mul-165.5%
*-commutative65.5%
distribute-lft-out65.5%
Simplified65.5%
Taylor expanded in x around 0 65.5%
mul-1-neg65.5%
sub-neg65.5%
metadata-eval65.5%
associate-*r*65.5%
distribute-lft-neg-in65.5%
cancel-sign-sub-inv65.5%
+-commutative65.5%
Simplified65.5%
Taylor expanded in y around inf 51.9%
if -2.64999999999999992e-70 < y < 3e-196Initial program 100.0%
Taylor expanded in t around inf 79.5%
Taylor expanded in x around inf 44.3%
if 3e-196 < y < 0.00700000000000000015Initial program 100.0%
Taylor expanded in t around 0 58.9%
mul-1-neg58.9%
distribute-rgt-neg-in58.9%
sub-neg58.9%
+-commutative58.9%
distribute-neg-in58.9%
remove-double-neg58.9%
sub-neg58.9%
Simplified58.9%
Taylor expanded in z around inf 39.7%
Final simplification48.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))) (t_2 (+ x (* (- y z) t))))
(if (<= t -2.15e-32)
t_2
(if (<= t -2.95e-92)
t_1
(if (<= t -3.5e-269) (+ x (* x z)) (if (<= t 5.5e-131) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = x + ((y - z) * t);
double tmp;
if (t <= -2.15e-32) {
tmp = t_2;
} else if (t <= -2.95e-92) {
tmp = t_1;
} else if (t <= -3.5e-269) {
tmp = x + (x * z);
} else if (t <= 5.5e-131) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (1.0d0 - y)
t_2 = x + ((y - z) * t)
if (t <= (-2.15d-32)) then
tmp = t_2
else if (t <= (-2.95d-92)) then
tmp = t_1
else if (t <= (-3.5d-269)) then
tmp = x + (x * z)
else if (t <= 5.5d-131) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double t_2 = x + ((y - z) * t);
double tmp;
if (t <= -2.15e-32) {
tmp = t_2;
} else if (t <= -2.95e-92) {
tmp = t_1;
} else if (t <= -3.5e-269) {
tmp = x + (x * z);
} else if (t <= 5.5e-131) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) t_2 = x + ((y - z) * t) tmp = 0 if t <= -2.15e-32: tmp = t_2 elif t <= -2.95e-92: tmp = t_1 elif t <= -3.5e-269: tmp = x + (x * z) elif t <= 5.5e-131: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) t_2 = Float64(x + Float64(Float64(y - z) * t)) tmp = 0.0 if (t <= -2.15e-32) tmp = t_2; elseif (t <= -2.95e-92) tmp = t_1; elseif (t <= -3.5e-269) tmp = Float64(x + Float64(x * z)); elseif (t <= 5.5e-131) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); t_2 = x + ((y - z) * t); tmp = 0.0; if (t <= -2.15e-32) tmp = t_2; elseif (t <= -2.95e-92) tmp = t_1; elseif (t <= -3.5e-269) tmp = x + (x * z); elseif (t <= 5.5e-131) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.15e-32], t$95$2, If[LessEqual[t, -2.95e-92], t$95$1, If[LessEqual[t, -3.5e-269], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e-131], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
t_2 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -2.15 \cdot 10^{-32}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2.95 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3.5 \cdot 10^{-269}:\\
\;\;\;\;x + x \cdot z\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-131}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.14999999999999995e-32 or 5.4999999999999997e-131 < t Initial program 100.0%
Taylor expanded in t around inf 81.4%
if -2.14999999999999995e-32 < t < -2.95e-92 or -3.50000000000000019e-269 < t < 5.4999999999999997e-131Initial program 99.9%
Taylor expanded in t around 0 89.6%
mul-1-neg89.6%
distribute-rgt-neg-in89.6%
sub-neg89.6%
+-commutative89.6%
distribute-neg-in89.6%
remove-double-neg89.6%
sub-neg89.6%
Simplified89.6%
Taylor expanded in z around 0 71.7%
mul-1-neg71.7%
*-rgt-identity71.7%
distribute-rgt-neg-in71.7%
mul-1-neg71.7%
distribute-lft-in71.7%
mul-1-neg71.7%
unsub-neg71.7%
Simplified71.7%
if -2.95e-92 < t < -3.50000000000000019e-269Initial program 100.0%
Taylor expanded in t around 0 90.7%
mul-1-neg90.7%
distribute-rgt-neg-in90.7%
sub-neg90.7%
+-commutative90.7%
distribute-neg-in90.7%
remove-double-neg90.7%
sub-neg90.7%
Simplified90.7%
Taylor expanded in y around 0 70.2%
Final simplification77.5%
(FPCore (x y z t) :precision binary64 (if (<= y -6.2e-72) (* y t) (if (<= y 3.5e-197) x (if (<= y 0.024) (* x z) (* y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.2e-72) {
tmp = y * t;
} else if (y <= 3.5e-197) {
tmp = x;
} else if (y <= 0.024) {
tmp = x * z;
} else {
tmp = y * 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 (y <= (-6.2d-72)) then
tmp = y * t
else if (y <= 3.5d-197) then
tmp = x
else if (y <= 0.024d0) then
tmp = x * z
else
tmp = y * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.2e-72) {
tmp = y * t;
} else if (y <= 3.5e-197) {
tmp = x;
} else if (y <= 0.024) {
tmp = x * z;
} else {
tmp = y * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.2e-72: tmp = y * t elif y <= 3.5e-197: tmp = x elif y <= 0.024: tmp = x * z else: tmp = y * t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.2e-72) tmp = Float64(y * t); elseif (y <= 3.5e-197) tmp = x; elseif (y <= 0.024) tmp = Float64(x * z); else tmp = Float64(y * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.2e-72) tmp = y * t; elseif (y <= 3.5e-197) tmp = x; elseif (y <= 0.024) tmp = x * z; else tmp = y * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.2e-72], N[(y * t), $MachinePrecision], If[LessEqual[y, 3.5e-197], x, If[LessEqual[y, 0.024], N[(x * z), $MachinePrecision], N[(y * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{-72}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-197}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 0.024:\\
\;\;\;\;x \cdot z\\
\mathbf{else}:\\
\;\;\;\;y \cdot t\\
\end{array}
\end{array}
if y < -6.1999999999999996e-72 or 0.024 < y Initial program 100.0%
Taylor expanded in t around inf 55.0%
Taylor expanded in y around -inf 52.1%
mul-1-neg52.1%
*-commutative52.1%
distribute-rgt-neg-in52.1%
neg-mul-152.1%
+-commutative52.1%
associate-/l*55.0%
neg-mul-155.0%
*-commutative55.0%
distribute-lft-out55.0%
Simplified55.0%
Taylor expanded in x around 0 55.0%
mul-1-neg55.0%
sub-neg55.0%
metadata-eval55.0%
associate-*r*55.0%
distribute-lft-neg-in55.0%
cancel-sign-sub-inv55.0%
+-commutative55.0%
Simplified55.0%
Taylor expanded in y around inf 46.6%
if -6.1999999999999996e-72 < y < 3.4999999999999998e-197Initial program 100.0%
Taylor expanded in t around inf 79.5%
Taylor expanded in x around inf 44.3%
if 3.4999999999999998e-197 < y < 0.024Initial program 100.0%
Taylor expanded in t around 0 58.9%
mul-1-neg58.9%
distribute-rgt-neg-in58.9%
sub-neg58.9%
+-commutative58.9%
distribute-neg-in58.9%
remove-double-neg58.9%
sub-neg58.9%
Simplified58.9%
Taylor expanded in z around inf 39.7%
Final simplification44.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -9e+39) (not (<= t 1.85e+67))) (+ x (* (- y z) t)) (+ x (* x (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9e+39) || !(t <= 1.85e+67)) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - y));
}
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 <= (-9d+39)) .or. (.not. (t <= 1.85d+67))) then
tmp = x + ((y - z) * t)
else
tmp = x + (x * (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9e+39) || !(t <= 1.85e+67)) {
tmp = x + ((y - z) * t);
} else {
tmp = x + (x * (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9e+39) or not (t <= 1.85e+67): tmp = x + ((y - z) * t) else: tmp = x + (x * (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9e+39) || !(t <= 1.85e+67)) tmp = Float64(x + Float64(Float64(y - z) * t)); else tmp = Float64(x + Float64(x * Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -9e+39) || ~((t <= 1.85e+67))) tmp = x + ((y - z) * t); else tmp = x + (x * (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9e+39], N[Not[LessEqual[t, 1.85e+67]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+39} \lor \neg \left(t \leq 1.85 \cdot 10^{+67}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\end{array}
\end{array}
if t < -8.99999999999999991e39 or 1.8499999999999999e67 < t Initial program 100.0%
Taylor expanded in t around inf 89.8%
if -8.99999999999999991e39 < t < 1.8499999999999999e67Initial program 100.0%
Taylor expanded in t around 0 81.7%
mul-1-neg81.7%
distribute-rgt-neg-in81.7%
sub-neg81.7%
+-commutative81.7%
distribute-neg-in81.7%
remove-double-neg81.7%
sub-neg81.7%
Simplified81.7%
Final simplification85.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.38e-27) (not (<= y 0.00021))) (+ x (* y (- t x))) (+ x (* z (- x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.38e-27) || !(y <= 0.00021)) {
tmp = x + (y * (t - x));
} else {
tmp = x + (z * (x - 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 ((y <= (-1.38d-27)) .or. (.not. (y <= 0.00021d0))) then
tmp = x + (y * (t - x))
else
tmp = x + (z * (x - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.38e-27) || !(y <= 0.00021)) {
tmp = x + (y * (t - x));
} else {
tmp = x + (z * (x - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.38e-27) or not (y <= 0.00021): tmp = x + (y * (t - x)) else: tmp = x + (z * (x - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.38e-27) || !(y <= 0.00021)) tmp = Float64(x + Float64(y * Float64(t - x))); else tmp = Float64(x + Float64(z * Float64(x - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.38e-27) || ~((y <= 0.00021))) tmp = x + (y * (t - x)); else tmp = x + (z * (x - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.38e-27], N[Not[LessEqual[y, 0.00021]], $MachinePrecision]], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.38 \cdot 10^{-27} \lor \neg \left(y \leq 0.00021\right):\\
\;\;\;\;x + y \cdot \left(t - x\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(x - t\right)\\
\end{array}
\end{array}
if y < -1.38e-27 or 2.1000000000000001e-4 < y Initial program 100.0%
Taylor expanded in y around inf 86.9%
*-commutative86.9%
Simplified86.9%
if -1.38e-27 < y < 2.1000000000000001e-4Initial program 100.0%
Taylor expanded in y around 0 93.0%
mul-1-neg93.0%
distribute-rgt-neg-in93.0%
sub-neg93.0%
+-commutative93.0%
distribute-neg-in93.0%
remove-double-neg93.0%
sub-neg93.0%
Simplified93.0%
Final simplification89.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.35e-70) (not (<= y 1.75e-29))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.35e-70) || !(y <= 1.75e-29)) {
tmp = y * t;
} else {
tmp = x;
}
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 ((y <= (-2.35d-70)) .or. (.not. (y <= 1.75d-29))) then
tmp = y * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.35e-70) || !(y <= 1.75e-29)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.35e-70) or not (y <= 1.75e-29): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.35e-70) || !(y <= 1.75e-29)) tmp = Float64(y * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.35e-70) || ~((y <= 1.75e-29))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.35e-70], N[Not[LessEqual[y, 1.75e-29]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.35 \cdot 10^{-70} \lor \neg \left(y \leq 1.75 \cdot 10^{-29}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.3499999999999999e-70 or 1.7499999999999999e-29 < y Initial program 100.0%
Taylor expanded in t around inf 54.5%
Taylor expanded in y around -inf 51.7%
mul-1-neg51.7%
*-commutative51.7%
distribute-rgt-neg-in51.7%
neg-mul-151.7%
+-commutative51.7%
associate-/l*54.5%
neg-mul-154.5%
*-commutative54.5%
distribute-lft-out54.5%
Simplified54.5%
Taylor expanded in x around 0 54.5%
mul-1-neg54.5%
sub-neg54.5%
metadata-eval54.5%
associate-*r*54.5%
distribute-lft-neg-in54.5%
cancel-sign-sub-inv54.5%
+-commutative54.5%
Simplified54.5%
Taylor expanded in y around inf 45.7%
if -2.3499999999999999e-70 < y < 1.7499999999999999e-29Initial program 100.0%
Taylor expanded in t around inf 75.3%
Taylor expanded in x around inf 36.4%
Final simplification41.7%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 100.0%
Taylor expanded in t around inf 63.6%
Taylor expanded in x around inf 18.7%
Final simplification18.7%
(FPCore (x y z t) :precision binary64 (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
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 + ((t * (y - z)) + (-x * (y - z)))
end function
public static double code(double x, double y, double z, double t) {
return x + ((t * (y - z)) + (-x * (y - z)));
}
def code(x, y, z, t): return x + ((t * (y - z)) + (-x * (y - z)))
function code(x, y, z, t) return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z)))) end
function tmp = code(x, y, z, t) tmp = x + ((t * (y - z)) + (-x * (y - z))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
\end{array}
herbie shell --seed 2024058
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:alt
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))