
(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 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- x))))
(if (<= z -1.5e+31)
(* z (- t))
(if (<= z -4.2e-64)
t_1
(if (<= z -7.3e-205)
(* y t)
(if (<= z -9.5e-259)
t_1
(if (<= z -2.8e-273)
x
(if (<= z 1.45e-303)
(* y t)
(if (<= z 9.2e-234)
x
(if (<= z 6.5e-172)
t_1
(if (<= z 6.4e-105)
x
(if (<= z 1100000000000.0) (* y t) (* z x)))))))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * -x;
double tmp;
if (z <= -1.5e+31) {
tmp = z * -t;
} else if (z <= -4.2e-64) {
tmp = t_1;
} else if (z <= -7.3e-205) {
tmp = y * t;
} else if (z <= -9.5e-259) {
tmp = t_1;
} else if (z <= -2.8e-273) {
tmp = x;
} else if (z <= 1.45e-303) {
tmp = y * t;
} else if (z <= 9.2e-234) {
tmp = x;
} else if (z <= 6.5e-172) {
tmp = t_1;
} else if (z <= 6.4e-105) {
tmp = x;
} else if (z <= 1100000000000.0) {
tmp = y * t;
} else {
tmp = z * 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) :: t_1
real(8) :: tmp
t_1 = y * -x
if (z <= (-1.5d+31)) then
tmp = z * -t
else if (z <= (-4.2d-64)) then
tmp = t_1
else if (z <= (-7.3d-205)) then
tmp = y * t
else if (z <= (-9.5d-259)) then
tmp = t_1
else if (z <= (-2.8d-273)) then
tmp = x
else if (z <= 1.45d-303) then
tmp = y * t
else if (z <= 9.2d-234) then
tmp = x
else if (z <= 6.5d-172) then
tmp = t_1
else if (z <= 6.4d-105) then
tmp = x
else if (z <= 1100000000000.0d0) then
tmp = y * t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * -x;
double tmp;
if (z <= -1.5e+31) {
tmp = z * -t;
} else if (z <= -4.2e-64) {
tmp = t_1;
} else if (z <= -7.3e-205) {
tmp = y * t;
} else if (z <= -9.5e-259) {
tmp = t_1;
} else if (z <= -2.8e-273) {
tmp = x;
} else if (z <= 1.45e-303) {
tmp = y * t;
} else if (z <= 9.2e-234) {
tmp = x;
} else if (z <= 6.5e-172) {
tmp = t_1;
} else if (z <= 6.4e-105) {
tmp = x;
} else if (z <= 1100000000000.0) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * -x tmp = 0 if z <= -1.5e+31: tmp = z * -t elif z <= -4.2e-64: tmp = t_1 elif z <= -7.3e-205: tmp = y * t elif z <= -9.5e-259: tmp = t_1 elif z <= -2.8e-273: tmp = x elif z <= 1.45e-303: tmp = y * t elif z <= 9.2e-234: tmp = x elif z <= 6.5e-172: tmp = t_1 elif z <= 6.4e-105: tmp = x elif z <= 1100000000000.0: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(-x)) tmp = 0.0 if (z <= -1.5e+31) tmp = Float64(z * Float64(-t)); elseif (z <= -4.2e-64) tmp = t_1; elseif (z <= -7.3e-205) tmp = Float64(y * t); elseif (z <= -9.5e-259) tmp = t_1; elseif (z <= -2.8e-273) tmp = x; elseif (z <= 1.45e-303) tmp = Float64(y * t); elseif (z <= 9.2e-234) tmp = x; elseif (z <= 6.5e-172) tmp = t_1; elseif (z <= 6.4e-105) tmp = x; elseif (z <= 1100000000000.0) tmp = Float64(y * t); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * -x; tmp = 0.0; if (z <= -1.5e+31) tmp = z * -t; elseif (z <= -4.2e-64) tmp = t_1; elseif (z <= -7.3e-205) tmp = y * t; elseif (z <= -9.5e-259) tmp = t_1; elseif (z <= -2.8e-273) tmp = x; elseif (z <= 1.45e-303) tmp = y * t; elseif (z <= 9.2e-234) tmp = x; elseif (z <= 6.5e-172) tmp = t_1; elseif (z <= 6.4e-105) tmp = x; elseif (z <= 1100000000000.0) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[z, -1.5e+31], N[(z * (-t)), $MachinePrecision], If[LessEqual[z, -4.2e-64], t$95$1, If[LessEqual[z, -7.3e-205], N[(y * t), $MachinePrecision], If[LessEqual[z, -9.5e-259], t$95$1, If[LessEqual[z, -2.8e-273], x, If[LessEqual[z, 1.45e-303], N[(y * t), $MachinePrecision], If[LessEqual[z, 9.2e-234], x, If[LessEqual[z, 6.5e-172], t$95$1, If[LessEqual[z, 6.4e-105], x, If[LessEqual[z, 1100000000000.0], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(-x\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+31}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-64}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.3 \cdot 10^{-205}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-259}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-273}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-303}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-234}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-172}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.4 \cdot 10^{-105}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1100000000000:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -1.49999999999999995e31Initial program 99.9%
Taylor expanded in t around inf 61.4%
Taylor expanded in y around 0 54.2%
mul-1-neg54.2%
unsub-neg54.2%
*-commutative54.2%
Simplified54.2%
Taylor expanded in x around 0 54.7%
mul-1-neg54.7%
*-commutative54.7%
distribute-rgt-neg-in54.7%
Simplified54.7%
if -1.49999999999999995e31 < z < -4.20000000000000023e-64 or -7.29999999999999992e-205 < z < -9.4999999999999995e-259 or 9.19999999999999961e-234 < z < 6.50000000000000012e-172Initial program 99.9%
Taylor expanded in t around 0 75.2%
mul-1-neg75.2%
distribute-rgt-neg-in75.2%
neg-sub075.2%
sub-neg75.2%
+-commutative75.2%
associate--r+75.2%
neg-sub075.2%
remove-double-neg75.2%
Simplified75.2%
Taylor expanded in z around 0 70.1%
mul-1-neg70.1%
*-rgt-identity70.1%
distribute-rgt-neg-out70.1%
distribute-lft-in70.1%
unsub-neg70.1%
Simplified70.1%
Taylor expanded in y around inf 51.2%
associate-*r*51.2%
neg-mul-151.2%
Simplified51.2%
if -4.20000000000000023e-64 < z < -7.29999999999999992e-205 or -2.79999999999999985e-273 < z < 1.45000000000000007e-303 or 6.39999999999999962e-105 < z < 1.1e12Initial program 100.0%
Taylor expanded in y around inf 90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 73.4%
*-commutative73.4%
Simplified73.4%
Taylor expanded in x around 0 52.1%
if -9.4999999999999995e-259 < z < -2.79999999999999985e-273 or 1.45000000000000007e-303 < z < 9.19999999999999961e-234 or 6.50000000000000012e-172 < z < 6.39999999999999962e-105Initial program 100.0%
Taylor expanded in t around inf 87.2%
Taylor expanded in x around inf 65.6%
if 1.1e12 < z Initial program 100.0%
Taylor expanded in t around 0 67.5%
mul-1-neg67.5%
distribute-rgt-neg-in67.5%
neg-sub067.5%
sub-neg67.5%
+-commutative67.5%
associate--r+67.5%
neg-sub067.5%
remove-double-neg67.5%
Simplified67.5%
sub-neg67.5%
distribute-rgt-in63.0%
Applied egg-rr63.0%
associate-+r+63.0%
*-commutative63.0%
distribute-rgt-neg-out63.0%
unsub-neg63.0%
*-un-lft-identity63.0%
distribute-rgt-out63.0%
Applied egg-rr63.0%
Taylor expanded in z around inf 57.7%
Final simplification55.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (- t))) (t_2 (* y (- t x))) (t_3 (* x (- 1.0 y))))
(if (<= y -190.0)
t_2
(if (<= y -5.2e-187)
t_3
(if (<= y 3.7e-301)
t_1
(if (<= y 1.36e-221)
(* z x)
(if (<= y 5.2e-124)
x
(if (<= y 9.2e-32) t_1 (if (<= y 39000000.0) t_3 t_2)))))))))
double code(double x, double y, double z, double t) {
double t_1 = z * -t;
double t_2 = y * (t - x);
double t_3 = x * (1.0 - y);
double tmp;
if (y <= -190.0) {
tmp = t_2;
} else if (y <= -5.2e-187) {
tmp = t_3;
} else if (y <= 3.7e-301) {
tmp = t_1;
} else if (y <= 1.36e-221) {
tmp = z * x;
} else if (y <= 5.2e-124) {
tmp = x;
} else if (y <= 9.2e-32) {
tmp = t_1;
} else if (y <= 39000000.0) {
tmp = t_3;
} 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 = z * -t
t_2 = y * (t - x)
t_3 = x * (1.0d0 - y)
if (y <= (-190.0d0)) then
tmp = t_2
else if (y <= (-5.2d-187)) then
tmp = t_3
else if (y <= 3.7d-301) then
tmp = t_1
else if (y <= 1.36d-221) then
tmp = z * x
else if (y <= 5.2d-124) then
tmp = x
else if (y <= 9.2d-32) then
tmp = t_1
else if (y <= 39000000.0d0) then
tmp = t_3
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 = z * -t;
double t_2 = y * (t - x);
double t_3 = x * (1.0 - y);
double tmp;
if (y <= -190.0) {
tmp = t_2;
} else if (y <= -5.2e-187) {
tmp = t_3;
} else if (y <= 3.7e-301) {
tmp = t_1;
} else if (y <= 1.36e-221) {
tmp = z * x;
} else if (y <= 5.2e-124) {
tmp = x;
} else if (y <= 9.2e-32) {
tmp = t_1;
} else if (y <= 39000000.0) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * -t t_2 = y * (t - x) t_3 = x * (1.0 - y) tmp = 0 if y <= -190.0: tmp = t_2 elif y <= -5.2e-187: tmp = t_3 elif y <= 3.7e-301: tmp = t_1 elif y <= 1.36e-221: tmp = z * x elif y <= 5.2e-124: tmp = x elif y <= 9.2e-32: tmp = t_1 elif y <= 39000000.0: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(-t)) t_2 = Float64(y * Float64(t - x)) t_3 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (y <= -190.0) tmp = t_2; elseif (y <= -5.2e-187) tmp = t_3; elseif (y <= 3.7e-301) tmp = t_1; elseif (y <= 1.36e-221) tmp = Float64(z * x); elseif (y <= 5.2e-124) tmp = x; elseif (y <= 9.2e-32) tmp = t_1; elseif (y <= 39000000.0) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * -t; t_2 = y * (t - x); t_3 = x * (1.0 - y); tmp = 0.0; if (y <= -190.0) tmp = t_2; elseif (y <= -5.2e-187) tmp = t_3; elseif (y <= 3.7e-301) tmp = t_1; elseif (y <= 1.36e-221) tmp = z * x; elseif (y <= 5.2e-124) tmp = x; elseif (y <= 9.2e-32) tmp = t_1; elseif (y <= 39000000.0) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -190.0], t$95$2, If[LessEqual[y, -5.2e-187], t$95$3, If[LessEqual[y, 3.7e-301], t$95$1, If[LessEqual[y, 1.36e-221], N[(z * x), $MachinePrecision], If[LessEqual[y, 5.2e-124], x, If[LessEqual[y, 9.2e-32], t$95$1, If[LessEqual[y, 39000000.0], t$95$3, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
t_2 := y \cdot \left(t - x\right)\\
t_3 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;y \leq -190:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{-187}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-301}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{-221}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-124}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 39000000:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -190 or 3.9e7 < y Initial program 100.0%
Taylor expanded in y around inf 80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in x around -inf 78.5%
+-commutative78.5%
mul-1-neg78.5%
unsub-neg78.5%
*-commutative78.5%
sub-neg78.5%
metadata-eval78.5%
+-commutative78.5%
Simplified78.5%
Taylor expanded in y around inf 80.7%
if -190 < y < -5.1999999999999999e-187 or 9.2000000000000002e-32 < y < 3.9e7Initial program 100.0%
Taylor expanded in t around 0 79.3%
mul-1-neg79.3%
distribute-rgt-neg-in79.3%
neg-sub079.3%
sub-neg79.3%
+-commutative79.3%
associate--r+79.3%
neg-sub079.3%
remove-double-neg79.3%
Simplified79.3%
Taylor expanded in z around 0 57.1%
mul-1-neg57.1%
*-rgt-identity57.1%
distribute-rgt-neg-out57.1%
distribute-lft-in57.1%
unsub-neg57.1%
Simplified57.1%
if -5.1999999999999999e-187 < y < 3.6999999999999998e-301 or 5.1999999999999999e-124 < y < 9.2000000000000002e-32Initial program 99.9%
Taylor expanded in t around inf 90.2%
Taylor expanded in y around 0 76.9%
mul-1-neg76.9%
unsub-neg76.9%
*-commutative76.9%
Simplified76.9%
Taylor expanded in x around 0 56.1%
mul-1-neg56.1%
*-commutative56.1%
distribute-rgt-neg-in56.1%
Simplified56.1%
if 3.6999999999999998e-301 < y < 1.3600000000000001e-221Initial program 100.0%
Taylor expanded in t around 0 79.2%
mul-1-neg79.2%
distribute-rgt-neg-in79.2%
neg-sub079.2%
sub-neg79.2%
+-commutative79.2%
associate--r+79.2%
neg-sub079.2%
remove-double-neg79.2%
Simplified79.2%
sub-neg79.2%
distribute-rgt-in79.2%
Applied egg-rr79.2%
associate-+r+79.2%
*-commutative79.2%
distribute-rgt-neg-out79.2%
unsub-neg79.2%
*-un-lft-identity79.2%
distribute-rgt-out79.2%
Applied egg-rr79.2%
Taylor expanded in z around inf 53.7%
if 1.3600000000000001e-221 < y < 5.1999999999999999e-124Initial program 100.0%
Taylor expanded in t around inf 86.3%
Taylor expanded in x around inf 59.3%
Final simplification69.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (- 1.0 y))))
(if (<= z -7.6e+32)
(* z (- t))
(if (<= z -1.55e-273)
t_1
(if (<= z -1.36e-306)
(* y t)
(if (<= z 1.95e-82)
t_1
(if (<= z 0.4) (* y t) (if (<= z 4.15e+24) t_1 (* z x)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - y);
double tmp;
if (z <= -7.6e+32) {
tmp = z * -t;
} else if (z <= -1.55e-273) {
tmp = t_1;
} else if (z <= -1.36e-306) {
tmp = y * t;
} else if (z <= 1.95e-82) {
tmp = t_1;
} else if (z <= 0.4) {
tmp = y * t;
} else if (z <= 4.15e+24) {
tmp = t_1;
} else {
tmp = z * 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) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 - y)
if (z <= (-7.6d+32)) then
tmp = z * -t
else if (z <= (-1.55d-273)) then
tmp = t_1
else if (z <= (-1.36d-306)) then
tmp = y * t
else if (z <= 1.95d-82) then
tmp = t_1
else if (z <= 0.4d0) then
tmp = y * t
else if (z <= 4.15d+24) then
tmp = t_1
else
tmp = z * x
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 <= -7.6e+32) {
tmp = z * -t;
} else if (z <= -1.55e-273) {
tmp = t_1;
} else if (z <= -1.36e-306) {
tmp = y * t;
} else if (z <= 1.95e-82) {
tmp = t_1;
} else if (z <= 0.4) {
tmp = y * t;
} else if (z <= 4.15e+24) {
tmp = t_1;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - y) tmp = 0 if z <= -7.6e+32: tmp = z * -t elif z <= -1.55e-273: tmp = t_1 elif z <= -1.36e-306: tmp = y * t elif z <= 1.95e-82: tmp = t_1 elif z <= 0.4: tmp = y * t elif z <= 4.15e+24: tmp = t_1 else: tmp = z * x return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - y)) tmp = 0.0 if (z <= -7.6e+32) tmp = Float64(z * Float64(-t)); elseif (z <= -1.55e-273) tmp = t_1; elseif (z <= -1.36e-306) tmp = Float64(y * t); elseif (z <= 1.95e-82) tmp = t_1; elseif (z <= 0.4) tmp = Float64(y * t); elseif (z <= 4.15e+24) tmp = t_1; else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - y); tmp = 0.0; if (z <= -7.6e+32) tmp = z * -t; elseif (z <= -1.55e-273) tmp = t_1; elseif (z <= -1.36e-306) tmp = y * t; elseif (z <= 1.95e-82) tmp = t_1; elseif (z <= 0.4) tmp = y * t; elseif (z <= 4.15e+24) tmp = t_1; else tmp = z * x; 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, -7.6e+32], N[(z * (-t)), $MachinePrecision], If[LessEqual[z, -1.55e-273], t$95$1, If[LessEqual[z, -1.36e-306], N[(y * t), $MachinePrecision], If[LessEqual[z, 1.95e-82], t$95$1, If[LessEqual[z, 0.4], N[(y * t), $MachinePrecision], If[LessEqual[z, 4.15e+24], t$95$1, N[(z * x), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -7.6 \cdot 10^{+32}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-273}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.36 \cdot 10^{-306}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{-82}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 0.4:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 4.15 \cdot 10^{+24}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -7.6000000000000006e32Initial program 99.9%
Taylor expanded in t around inf 61.4%
Taylor expanded in y around 0 54.2%
mul-1-neg54.2%
unsub-neg54.2%
*-commutative54.2%
Simplified54.2%
Taylor expanded in x around 0 54.7%
mul-1-neg54.7%
*-commutative54.7%
distribute-rgt-neg-in54.7%
Simplified54.7%
if -7.6000000000000006e32 < z < -1.54999999999999994e-273 or -1.35999999999999996e-306 < z < 1.94999999999999987e-82 or 0.40000000000000002 < z < 4.1500000000000002e24Initial program 100.0%
Taylor expanded in t around 0 72.3%
mul-1-neg72.3%
distribute-rgt-neg-in72.3%
neg-sub072.3%
sub-neg72.3%
+-commutative72.3%
associate--r+72.3%
neg-sub072.3%
remove-double-neg72.3%
Simplified72.3%
Taylor expanded in z around 0 69.7%
mul-1-neg69.7%
*-rgt-identity69.7%
distribute-rgt-neg-out69.7%
distribute-lft-in69.7%
unsub-neg69.7%
Simplified69.7%
if -1.54999999999999994e-273 < z < -1.35999999999999996e-306 or 1.94999999999999987e-82 < z < 0.40000000000000002Initial program 99.9%
Taylor expanded in y around inf 81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in t around inf 78.3%
*-commutative78.3%
Simplified78.3%
Taylor expanded in x around 0 59.2%
if 4.1500000000000002e24 < z Initial program 100.0%
Taylor expanded in t around 0 66.0%
mul-1-neg66.0%
distribute-rgt-neg-in66.0%
neg-sub066.0%
sub-neg66.0%
+-commutative66.0%
associate--r+66.0%
neg-sub066.0%
remove-double-neg66.0%
Simplified66.0%
sub-neg66.0%
distribute-rgt-in61.3%
Applied egg-rr61.3%
associate-+r+61.3%
*-commutative61.3%
distribute-rgt-neg-out61.3%
unsub-neg61.3%
*-un-lft-identity61.3%
distribute-rgt-out61.3%
Applied egg-rr61.3%
Taylor expanded in z around inf 57.5%
Final simplification62.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (+ x (* (- y z) t))))
(if (<= y -2e+36)
t_1
(if (<= y 2.15e-305)
t_2
(if (<= y 3.5e-217) (+ x (* z x)) (if (<= y 2.2e+59) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x + ((y - z) * t);
double tmp;
if (y <= -2e+36) {
tmp = t_1;
} else if (y <= 2.15e-305) {
tmp = t_2;
} else if (y <= 3.5e-217) {
tmp = x + (z * x);
} else if (y <= 2.2e+59) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = y * (t - x)
t_2 = x + ((y - z) * t)
if (y <= (-2d+36)) then
tmp = t_1
else if (y <= 2.15d-305) then
tmp = t_2
else if (y <= 3.5d-217) then
tmp = x + (z * x)
else if (y <= 2.2d+59) then
tmp = t_2
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 = y * (t - x);
double t_2 = x + ((y - z) * t);
double tmp;
if (y <= -2e+36) {
tmp = t_1;
} else if (y <= 2.15e-305) {
tmp = t_2;
} else if (y <= 3.5e-217) {
tmp = x + (z * x);
} else if (y <= 2.2e+59) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x + ((y - z) * t) tmp = 0 if y <= -2e+36: tmp = t_1 elif y <= 2.15e-305: tmp = t_2 elif y <= 3.5e-217: tmp = x + (z * x) elif y <= 2.2e+59: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(x + Float64(Float64(y - z) * t)) tmp = 0.0 if (y <= -2e+36) tmp = t_1; elseif (y <= 2.15e-305) tmp = t_2; elseif (y <= 3.5e-217) tmp = Float64(x + Float64(z * x)); elseif (y <= 2.2e+59) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = x + ((y - z) * t); tmp = 0.0; if (y <= -2e+36) tmp = t_1; elseif (y <= 2.15e-305) tmp = t_2; elseif (y <= 3.5e-217) tmp = x + (z * x); elseif (y <= 2.2e+59) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+36], t$95$1, If[LessEqual[y, 2.15e-305], t$95$2, If[LessEqual[y, 3.5e-217], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.2e+59], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x + \left(y - z\right) \cdot t\\
\mathbf{if}\;y \leq -2 \cdot 10^{+36}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{-305}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-217}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+59}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.00000000000000008e36 or 2.2e59 < y Initial program 100.0%
Taylor expanded in y around inf 82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in x around -inf 80.2%
+-commutative80.2%
mul-1-neg80.2%
unsub-neg80.2%
*-commutative80.2%
sub-neg80.2%
metadata-eval80.2%
+-commutative80.2%
Simplified80.2%
Taylor expanded in y around inf 82.6%
if -2.00000000000000008e36 < y < 2.1500000000000001e-305 or 3.5e-217 < y < 2.2e59Initial program 100.0%
Taylor expanded in t around inf 82.4%
if 2.1500000000000001e-305 < y < 3.5e-217Initial program 100.0%
Taylor expanded in t around 0 79.2%
mul-1-neg79.2%
distribute-rgt-neg-in79.2%
neg-sub079.2%
sub-neg79.2%
+-commutative79.2%
associate--r+79.2%
neg-sub079.2%
remove-double-neg79.2%
Simplified79.2%
Taylor expanded in y around 0 79.2%
Final simplification82.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (+ x (* z x))))
(if (<= y -1900000.0)
t_1
(if (<= y -7.5e-193)
t_2
(if (<= y -1.45e-274) (* z (- t)) (if (<= y 0.000118) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x + (z * x);
double tmp;
if (y <= -1900000.0) {
tmp = t_1;
} else if (y <= -7.5e-193) {
tmp = t_2;
} else if (y <= -1.45e-274) {
tmp = z * -t;
} else if (y <= 0.000118) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = y * (t - x)
t_2 = x + (z * x)
if (y <= (-1900000.0d0)) then
tmp = t_1
else if (y <= (-7.5d-193)) then
tmp = t_2
else if (y <= (-1.45d-274)) then
tmp = z * -t
else if (y <= 0.000118d0) then
tmp = t_2
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 = y * (t - x);
double t_2 = x + (z * x);
double tmp;
if (y <= -1900000.0) {
tmp = t_1;
} else if (y <= -7.5e-193) {
tmp = t_2;
} else if (y <= -1.45e-274) {
tmp = z * -t;
} else if (y <= 0.000118) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x + (z * x) tmp = 0 if y <= -1900000.0: tmp = t_1 elif y <= -7.5e-193: tmp = t_2 elif y <= -1.45e-274: tmp = z * -t elif y <= 0.000118: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(x + Float64(z * x)) tmp = 0.0 if (y <= -1900000.0) tmp = t_1; elseif (y <= -7.5e-193) tmp = t_2; elseif (y <= -1.45e-274) tmp = Float64(z * Float64(-t)); elseif (y <= 0.000118) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = x + (z * x); tmp = 0.0; if (y <= -1900000.0) tmp = t_1; elseif (y <= -7.5e-193) tmp = t_2; elseif (y <= -1.45e-274) tmp = z * -t; elseif (y <= 0.000118) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1900000.0], t$95$1, If[LessEqual[y, -7.5e-193], t$95$2, If[LessEqual[y, -1.45e-274], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 0.000118], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x + z \cdot x\\
\mathbf{if}\;y \leq -1900000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-193}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-274}:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;y \leq 0.000118:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.9e6 or 1.18e-4 < y Initial program 100.0%
Taylor expanded in y around inf 82.0%
*-commutative82.0%
Simplified82.0%
Taylor expanded in x around -inf 79.8%
+-commutative79.8%
mul-1-neg79.8%
unsub-neg79.8%
*-commutative79.8%
sub-neg79.8%
metadata-eval79.8%
+-commutative79.8%
Simplified79.8%
Taylor expanded in y around inf 81.5%
if -1.9e6 < y < -7.4999999999999998e-193 or -1.44999999999999988e-274 < y < 1.18e-4Initial program 100.0%
Taylor expanded in t around 0 69.6%
mul-1-neg69.6%
distribute-rgt-neg-in69.6%
neg-sub069.6%
sub-neg69.6%
+-commutative69.6%
associate--r+69.6%
neg-sub069.6%
remove-double-neg69.6%
Simplified69.6%
Taylor expanded in y around 0 68.3%
if -7.4999999999999998e-193 < y < -1.44999999999999988e-274Initial program 99.8%
Taylor expanded in t around inf 89.4%
Taylor expanded in y around 0 74.9%
mul-1-neg74.9%
unsub-neg74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in x around 0 63.1%
mul-1-neg63.1%
*-commutative63.1%
distribute-rgt-neg-in63.1%
Simplified63.1%
Final simplification75.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (- t x))) (t_2 (- x (* z t))))
(if (<= y -1.32e+16)
t_1
(if (<= y 1.14e-302)
t_2
(if (<= y 5.3e-186) (+ x (* z x)) (if (<= y 1.65e-6) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (t - x);
double t_2 = x - (z * t);
double tmp;
if (y <= -1.32e+16) {
tmp = t_1;
} else if (y <= 1.14e-302) {
tmp = t_2;
} else if (y <= 5.3e-186) {
tmp = x + (z * x);
} else if (y <= 1.65e-6) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = y * (t - x)
t_2 = x - (z * t)
if (y <= (-1.32d+16)) then
tmp = t_1
else if (y <= 1.14d-302) then
tmp = t_2
else if (y <= 5.3d-186) then
tmp = x + (z * x)
else if (y <= 1.65d-6) then
tmp = t_2
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 = y * (t - x);
double t_2 = x - (z * t);
double tmp;
if (y <= -1.32e+16) {
tmp = t_1;
} else if (y <= 1.14e-302) {
tmp = t_2;
} else if (y <= 5.3e-186) {
tmp = x + (z * x);
} else if (y <= 1.65e-6) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (t - x) t_2 = x - (z * t) tmp = 0 if y <= -1.32e+16: tmp = t_1 elif y <= 1.14e-302: tmp = t_2 elif y <= 5.3e-186: tmp = x + (z * x) elif y <= 1.65e-6: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(t - x)) t_2 = Float64(x - Float64(z * t)) tmp = 0.0 if (y <= -1.32e+16) tmp = t_1; elseif (y <= 1.14e-302) tmp = t_2; elseif (y <= 5.3e-186) tmp = Float64(x + Float64(z * x)); elseif (y <= 1.65e-6) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (t - x); t_2 = x - (z * t); tmp = 0.0; if (y <= -1.32e+16) tmp = t_1; elseif (y <= 1.14e-302) tmp = t_2; elseif (y <= 5.3e-186) tmp = x + (z * x); elseif (y <= 1.65e-6) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.32e+16], t$95$1, If[LessEqual[y, 1.14e-302], t$95$2, If[LessEqual[y, 5.3e-186], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.65e-6], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
t_2 := x - z \cdot t\\
\mathbf{if}\;y \leq -1.32 \cdot 10^{+16}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.14 \cdot 10^{-302}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{-186}:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;y \leq 1.65 \cdot 10^{-6}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.32e16 or 1.65000000000000008e-6 < y Initial program 100.0%
Taylor expanded in y around inf 82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in x around -inf 80.3%
+-commutative80.3%
mul-1-neg80.3%
unsub-neg80.3%
*-commutative80.3%
sub-neg80.3%
metadata-eval80.3%
+-commutative80.3%
Simplified80.3%
Taylor expanded in y around inf 82.0%
if -1.32e16 < y < 1.13999999999999996e-302 or 5.30000000000000022e-186 < y < 1.65000000000000008e-6Initial program 100.0%
Taylor expanded in t around inf 82.0%
Taylor expanded in y around 0 73.8%
mul-1-neg73.8%
unsub-neg73.8%
*-commutative73.8%
Simplified73.8%
if 1.13999999999999996e-302 < y < 5.30000000000000022e-186Initial program 100.0%
Taylor expanded in t around 0 78.6%
mul-1-neg78.6%
distribute-rgt-neg-in78.6%
neg-sub078.6%
sub-neg78.6%
+-commutative78.6%
associate--r+78.6%
neg-sub078.6%
remove-double-neg78.6%
Simplified78.6%
Taylor expanded in y around 0 78.6%
Final simplification78.5%
(FPCore (x y z t)
:precision binary64
(if (<= z -4.5)
(* z x)
(if (<= z 1.25e-303)
(* y t)
(if (<= z 6.8e-107) x (if (<= z 23000000.0) (* y t) (* z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5) {
tmp = z * x;
} else if (z <= 1.25e-303) {
tmp = y * t;
} else if (z <= 6.8e-107) {
tmp = x;
} else if (z <= 23000000.0) {
tmp = y * t;
} else {
tmp = z * 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 (z <= (-4.5d0)) then
tmp = z * x
else if (z <= 1.25d-303) then
tmp = y * t
else if (z <= 6.8d-107) then
tmp = x
else if (z <= 23000000.0d0) then
tmp = y * t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4.5) {
tmp = z * x;
} else if (z <= 1.25e-303) {
tmp = y * t;
} else if (z <= 6.8e-107) {
tmp = x;
} else if (z <= 23000000.0) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4.5: tmp = z * x elif z <= 1.25e-303: tmp = y * t elif z <= 6.8e-107: tmp = x elif z <= 23000000.0: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4.5) tmp = Float64(z * x); elseif (z <= 1.25e-303) tmp = Float64(y * t); elseif (z <= 6.8e-107) tmp = x; elseif (z <= 23000000.0) tmp = Float64(y * t); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4.5) tmp = z * x; elseif (z <= 1.25e-303) tmp = y * t; elseif (z <= 6.8e-107) tmp = x; elseif (z <= 23000000.0) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4.5], N[(z * x), $MachinePrecision], If[LessEqual[z, 1.25e-303], N[(y * t), $MachinePrecision], If[LessEqual[z, 6.8e-107], x, If[LessEqual[z, 23000000.0], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-303}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-107}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 23000000:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -4.5 or 2.3e7 < z Initial program 99.9%
Taylor expanded in t around 0 60.7%
mul-1-neg60.7%
distribute-rgt-neg-in60.7%
neg-sub060.7%
sub-neg60.7%
+-commutative60.7%
associate--r+60.7%
neg-sub060.7%
remove-double-neg60.7%
Simplified60.7%
sub-neg60.7%
distribute-rgt-in57.5%
Applied egg-rr57.5%
associate-+r+57.5%
*-commutative57.5%
distribute-rgt-neg-out57.5%
unsub-neg57.5%
*-un-lft-identity57.5%
distribute-rgt-out57.5%
Applied egg-rr57.5%
Taylor expanded in z around inf 48.5%
if -4.5 < z < 1.25e-303 or 6.79999999999999989e-107 < z < 2.3e7Initial program 100.0%
Taylor expanded in y around inf 92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in t around inf 70.6%
*-commutative70.6%
Simplified70.6%
Taylor expanded in x around 0 45.6%
if 1.25e-303 < z < 6.79999999999999989e-107Initial program 99.9%
Taylor expanded in t around inf 73.8%
Taylor expanded in x around inf 47.6%
Final simplification47.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -115.0)
(* z (- t))
(if (<= z 1.35e-303)
(* y t)
(if (<= z 5e-116) x (if (<= z 17000000.0) (* y t) (* z x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -115.0) {
tmp = z * -t;
} else if (z <= 1.35e-303) {
tmp = y * t;
} else if (z <= 5e-116) {
tmp = x;
} else if (z <= 17000000.0) {
tmp = y * t;
} else {
tmp = z * 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 (z <= (-115.0d0)) then
tmp = z * -t
else if (z <= 1.35d-303) then
tmp = y * t
else if (z <= 5d-116) then
tmp = x
else if (z <= 17000000.0d0) then
tmp = y * t
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -115.0) {
tmp = z * -t;
} else if (z <= 1.35e-303) {
tmp = y * t;
} else if (z <= 5e-116) {
tmp = x;
} else if (z <= 17000000.0) {
tmp = y * t;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -115.0: tmp = z * -t elif z <= 1.35e-303: tmp = y * t elif z <= 5e-116: tmp = x elif z <= 17000000.0: tmp = y * t else: tmp = z * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -115.0) tmp = Float64(z * Float64(-t)); elseif (z <= 1.35e-303) tmp = Float64(y * t); elseif (z <= 5e-116) tmp = x; elseif (z <= 17000000.0) tmp = Float64(y * t); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -115.0) tmp = z * -t; elseif (z <= 1.35e-303) tmp = y * t; elseif (z <= 5e-116) tmp = x; elseif (z <= 17000000.0) tmp = y * t; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -115.0], N[(z * (-t)), $MachinePrecision], If[LessEqual[z, 1.35e-303], N[(y * t), $MachinePrecision], If[LessEqual[z, 5e-116], x, If[LessEqual[z, 17000000.0], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -115:\\
\;\;\;\;z \cdot \left(-t\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-303}:\\
\;\;\;\;y \cdot t\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-116}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 17000000:\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if z < -115Initial program 99.9%
Taylor expanded in t around inf 56.1%
Taylor expanded in y around 0 49.6%
mul-1-neg49.6%
unsub-neg49.6%
*-commutative49.6%
Simplified49.6%
Taylor expanded in x around 0 50.1%
mul-1-neg50.1%
*-commutative50.1%
distribute-rgt-neg-in50.1%
Simplified50.1%
if -115 < z < 1.34999999999999993e-303 or 5.0000000000000003e-116 < z < 1.7e7Initial program 100.0%
Taylor expanded in y around inf 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in t around inf 69.9%
*-commutative69.9%
Simplified69.9%
Taylor expanded in x around 0 45.1%
if 1.34999999999999993e-303 < z < 5.0000000000000003e-116Initial program 99.9%
Taylor expanded in t around inf 73.8%
Taylor expanded in x around inf 47.6%
if 1.7e7 < z Initial program 100.0%
Taylor expanded in t around 0 67.5%
mul-1-neg67.5%
distribute-rgt-neg-in67.5%
neg-sub067.5%
sub-neg67.5%
+-commutative67.5%
associate--r+67.5%
neg-sub067.5%
remove-double-neg67.5%
Simplified67.5%
sub-neg67.5%
distribute-rgt-in63.0%
Applied egg-rr63.0%
associate-+r+63.0%
*-commutative63.0%
distribute-rgt-neg-out63.0%
unsub-neg63.0%
*-un-lft-identity63.0%
distribute-rgt-out63.0%
Applied egg-rr63.0%
Taylor expanded in z around inf 57.7%
Final simplification49.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.7e-46) (not (<= x 2.1e+42))) (+ x (* x (- z y))) (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.7e-46) || !(x <= 2.1e+42)) {
tmp = x + (x * (z - y));
} else {
tmp = x + ((y - 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 ((x <= (-1.7d-46)) .or. (.not. (x <= 2.1d+42))) then
tmp = x + (x * (z - y))
else
tmp = x + ((y - z) * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.7e-46) || !(x <= 2.1e+42)) {
tmp = x + (x * (z - y));
} else {
tmp = x + ((y - z) * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.7e-46) or not (x <= 2.1e+42): tmp = x + (x * (z - y)) else: tmp = x + ((y - z) * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.7e-46) || !(x <= 2.1e+42)) tmp = Float64(x + Float64(x * Float64(z - y))); else tmp = Float64(x + Float64(Float64(y - z) * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.7e-46) || ~((x <= 2.1e+42))) tmp = x + (x * (z - y)); else tmp = x + ((y - z) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.7e-46], N[Not[LessEqual[x, 2.1e+42]], $MachinePrecision]], N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-46} \lor \neg \left(x \leq 2.1 \cdot 10^{+42}\right):\\
\;\;\;\;x + x \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\
\end{array}
\end{array}
if x < -1.69999999999999998e-46 or 2.09999999999999995e42 < x Initial program 100.0%
Taylor expanded in t around 0 87.1%
mul-1-neg87.1%
distribute-rgt-neg-in87.1%
neg-sub087.1%
sub-neg87.1%
+-commutative87.1%
associate--r+87.1%
neg-sub087.1%
remove-double-neg87.1%
Simplified87.1%
if -1.69999999999999998e-46 < x < 2.09999999999999995e42Initial program 99.9%
Taylor expanded in t around inf 84.4%
Final simplification85.9%
(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 (if (or (<= y -3.4) (not (<= y 6.4e-8))) (* y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.4) || !(y <= 6.4e-8)) {
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 <= (-3.4d0)) .or. (.not. (y <= 6.4d-8))) 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 <= -3.4) || !(y <= 6.4e-8)) {
tmp = y * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.4) or not (y <= 6.4e-8): tmp = y * t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.4) || !(y <= 6.4e-8)) tmp = Float64(y * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.4) || ~((y <= 6.4e-8))) tmp = y * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.4], N[Not[LessEqual[y, 6.4e-8]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \lor \neg \left(y \leq 6.4 \cdot 10^{-8}\right):\\
\;\;\;\;y \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.39999999999999991 or 6.4000000000000004e-8 < y Initial program 100.0%
Taylor expanded in y around inf 80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in t around inf 44.6%
*-commutative44.6%
Simplified44.6%
Taylor expanded in x around 0 43.9%
if -3.39999999999999991 < y < 6.4000000000000004e-8Initial program 100.0%
Taylor expanded in t around inf 78.4%
Taylor expanded in x around inf 38.2%
Final simplification41.3%
(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.7%
Taylor expanded in x around inf 19.2%
Final simplification19.2%
(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 2023309
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
:herbie-target
(+ x (+ (* t (- y z)) (* (- x) (- y z))))
(+ x (* (- y z) (- t x))))