
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
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) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
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) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t) :precision binary64 (fma y 5.0 (* x (+ (* (+ y z) 2.0) t))))
double code(double x, double y, double z, double t) {
return fma(y, 5.0, (x * (((y + z) * 2.0) + t)));
}
function code(x, y, z, t) return fma(y, 5.0, Float64(x * Float64(Float64(Float64(y + z) * 2.0) + t))) end
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 5, x \cdot \left(\left(y + z\right) \cdot 2 + t\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-define100.0%
*-un-lft-identity100.0%
*-un-lft-identity100.0%
associate-+l+100.0%
*-un-lft-identity100.0%
+-commutative100.0%
*-un-lft-identity100.0%
distribute-rgt-out100.0%
metadata-eval100.0%
Applied egg-rr100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -2.4e+65)
t_1
(if (<= y -9.4e+32)
(* x (+ t (* y 2.0)))
(if (<= y -8.5e+14)
t_1
(if (<= y 5.9e-6)
(* x (+ t (* z 2.0)))
(if (<= y 2e+67)
(+ (* y 5.0) (* x t))
(if (<= y 1e+83) (* x (* (+ y z) 2.0)) t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -2.4e+65) {
tmp = t_1;
} else if (y <= -9.4e+32) {
tmp = x * (t + (y * 2.0));
} else if (y <= -8.5e+14) {
tmp = t_1;
} else if (y <= 5.9e-6) {
tmp = x * (t + (z * 2.0));
} else if (y <= 2e+67) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 1e+83) {
tmp = x * ((y + z) * 2.0);
} 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 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-2.4d+65)) then
tmp = t_1
else if (y <= (-9.4d+32)) then
tmp = x * (t + (y * 2.0d0))
else if (y <= (-8.5d+14)) then
tmp = t_1
else if (y <= 5.9d-6) then
tmp = x * (t + (z * 2.0d0))
else if (y <= 2d+67) then
tmp = (y * 5.0d0) + (x * t)
else if (y <= 1d+83) then
tmp = x * ((y + z) * 2.0d0)
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 * (5.0 + (x * 2.0));
double tmp;
if (y <= -2.4e+65) {
tmp = t_1;
} else if (y <= -9.4e+32) {
tmp = x * (t + (y * 2.0));
} else if (y <= -8.5e+14) {
tmp = t_1;
} else if (y <= 5.9e-6) {
tmp = x * (t + (z * 2.0));
} else if (y <= 2e+67) {
tmp = (y * 5.0) + (x * t);
} else if (y <= 1e+83) {
tmp = x * ((y + z) * 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -2.4e+65: tmp = t_1 elif y <= -9.4e+32: tmp = x * (t + (y * 2.0)) elif y <= -8.5e+14: tmp = t_1 elif y <= 5.9e-6: tmp = x * (t + (z * 2.0)) elif y <= 2e+67: tmp = (y * 5.0) + (x * t) elif y <= 1e+83: tmp = x * ((y + z) * 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -2.4e+65) tmp = t_1; elseif (y <= -9.4e+32) tmp = Float64(x * Float64(t + Float64(y * 2.0))); elseif (y <= -8.5e+14) tmp = t_1; elseif (y <= 5.9e-6) tmp = Float64(x * Float64(t + Float64(z * 2.0))); elseif (y <= 2e+67) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (y <= 1e+83) tmp = Float64(x * Float64(Float64(y + z) * 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -2.4e+65) tmp = t_1; elseif (y <= -9.4e+32) tmp = x * (t + (y * 2.0)); elseif (y <= -8.5e+14) tmp = t_1; elseif (y <= 5.9e-6) tmp = x * (t + (z * 2.0)); elseif (y <= 2e+67) tmp = (y * 5.0) + (x * t); elseif (y <= 1e+83) tmp = x * ((y + z) * 2.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e+65], t$95$1, If[LessEqual[y, -9.4e+32], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -8.5e+14], t$95$1, If[LessEqual[y, 5.9e-6], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+67], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+83], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9.4 \cdot 10^{+32}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.9 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+67}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;y \leq 10^{+83}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.4000000000000002e65 or -9.40000000000000047e32 < y < -8.5e14 or 1.00000000000000003e83 < y Initial program 99.8%
Taylor expanded in y around inf 87.1%
Simplified87.1%
if -2.4000000000000002e65 < y < -9.40000000000000047e32Initial program 100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in z around 0 78.0%
if -8.5e14 < y < 5.90000000000000026e-6Initial program 100.0%
Taylor expanded in y around 0 83.9%
if 5.90000000000000026e-6 < y < 1.99999999999999997e67Initial program 99.9%
Taylor expanded in y around 0 99.9%
Taylor expanded in z around 0 80.7%
if 1.99999999999999997e67 < y < 1.00000000000000003e83Initial program 100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in t around 0 100.0%
distribute-lft-in100.0%
+-commutative100.0%
Simplified100.0%
Final simplification84.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* y 5.0) (* 2.0 (* x z)))) (t_2 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -3.5e+134)
t_2
(if (<= y -5.5e+45)
t_1
(if (<= y -38000000000000.0)
t_2
(if (<= y 7.6e-164)
(* x (+ t (* z 2.0)))
(if (<= y 2e+152) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (2.0 * (x * z));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -3.5e+134) {
tmp = t_2;
} else if (y <= -5.5e+45) {
tmp = t_1;
} else if (y <= -38000000000000.0) {
tmp = t_2;
} else if (y <= 7.6e-164) {
tmp = x * (t + (z * 2.0));
} else if (y <= 2e+152) {
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 = (y * 5.0d0) + (2.0d0 * (x * z))
t_2 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-3.5d+134)) then
tmp = t_2
else if (y <= (-5.5d+45)) then
tmp = t_1
else if (y <= (-38000000000000.0d0)) then
tmp = t_2
else if (y <= 7.6d-164) then
tmp = x * (t + (z * 2.0d0))
else if (y <= 2d+152) 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 = (y * 5.0) + (2.0 * (x * z));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -3.5e+134) {
tmp = t_2;
} else if (y <= -5.5e+45) {
tmp = t_1;
} else if (y <= -38000000000000.0) {
tmp = t_2;
} else if (y <= 7.6e-164) {
tmp = x * (t + (z * 2.0));
} else if (y <= 2e+152) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * 5.0) + (2.0 * (x * z)) t_2 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -3.5e+134: tmp = t_2 elif y <= -5.5e+45: tmp = t_1 elif y <= -38000000000000.0: tmp = t_2 elif y <= 7.6e-164: tmp = x * (t + (z * 2.0)) elif y <= 2e+152: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))) t_2 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -3.5e+134) tmp = t_2; elseif (y <= -5.5e+45) tmp = t_1; elseif (y <= -38000000000000.0) tmp = t_2; elseif (y <= 7.6e-164) tmp = Float64(x * Float64(t + Float64(z * 2.0))); elseif (y <= 2e+152) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * 5.0) + (2.0 * (x * z)); t_2 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -3.5e+134) tmp = t_2; elseif (y <= -5.5e+45) tmp = t_1; elseif (y <= -38000000000000.0) tmp = t_2; elseif (y <= 7.6e-164) tmp = x * (t + (z * 2.0)); elseif (y <= 2e+152) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.5e+134], t$95$2, If[LessEqual[y, -5.5e+45], t$95$1, If[LessEqual[y, -38000000000000.0], t$95$2, If[LessEqual[y, 7.6e-164], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+152], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+134}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -38000000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-164}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+152}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -3.50000000000000003e134 or -5.5000000000000001e45 < y < -3.8e13 or 2.0000000000000001e152 < y Initial program 99.9%
Taylor expanded in y around inf 91.1%
Simplified91.1%
if -3.50000000000000003e134 < y < -5.5000000000000001e45 or 7.59999999999999979e-164 < y < 2.0000000000000001e152Initial program 99.9%
Taylor expanded in y around 0 89.0%
Taylor expanded in t around 0 77.2%
if -3.8e13 < y < 7.59999999999999979e-164Initial program 99.9%
Taylor expanded in y around 0 88.5%
Final simplification85.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* y 2.0)))) (t_2 (* x (* (+ y z) 2.0))))
(if (<= x -8e+195)
t_2
(if (<= x -2.2e+135)
t_1
(if (<= x -1.22e-61)
t_2
(if (<= x 3.6e-120) (* y 5.0) (if (<= x 2.4e+38) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (y * 2.0));
double t_2 = x * ((y + z) * 2.0);
double tmp;
if (x <= -8e+195) {
tmp = t_2;
} else if (x <= -2.2e+135) {
tmp = t_1;
} else if (x <= -1.22e-61) {
tmp = t_2;
} else if (x <= 3.6e-120) {
tmp = y * 5.0;
} else if (x <= 2.4e+38) {
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 = x * (t + (y * 2.0d0))
t_2 = x * ((y + z) * 2.0d0)
if (x <= (-8d+195)) then
tmp = t_2
else if (x <= (-2.2d+135)) then
tmp = t_1
else if (x <= (-1.22d-61)) then
tmp = t_2
else if (x <= 3.6d-120) then
tmp = y * 5.0d0
else if (x <= 2.4d+38) 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 = x * (t + (y * 2.0));
double t_2 = x * ((y + z) * 2.0);
double tmp;
if (x <= -8e+195) {
tmp = t_2;
} else if (x <= -2.2e+135) {
tmp = t_1;
} else if (x <= -1.22e-61) {
tmp = t_2;
} else if (x <= 3.6e-120) {
tmp = y * 5.0;
} else if (x <= 2.4e+38) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (y * 2.0)) t_2 = x * ((y + z) * 2.0) tmp = 0 if x <= -8e+195: tmp = t_2 elif x <= -2.2e+135: tmp = t_1 elif x <= -1.22e-61: tmp = t_2 elif x <= 3.6e-120: tmp = y * 5.0 elif x <= 2.4e+38: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(y * 2.0))) t_2 = Float64(x * Float64(Float64(y + z) * 2.0)) tmp = 0.0 if (x <= -8e+195) tmp = t_2; elseif (x <= -2.2e+135) tmp = t_1; elseif (x <= -1.22e-61) tmp = t_2; elseif (x <= 3.6e-120) tmp = Float64(y * 5.0); elseif (x <= 2.4e+38) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (y * 2.0)); t_2 = x * ((y + z) * 2.0); tmp = 0.0; if (x <= -8e+195) tmp = t_2; elseif (x <= -2.2e+135) tmp = t_1; elseif (x <= -1.22e-61) tmp = t_2; elseif (x <= 3.6e-120) tmp = y * 5.0; elseif (x <= 2.4e+38) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e+195], t$95$2, If[LessEqual[x, -2.2e+135], t$95$1, If[LessEqual[x, -1.22e-61], t$95$2, If[LessEqual[x, 3.6e-120], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 2.4e+38], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + y \cdot 2\right)\\
t_2 := x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -8 \cdot 10^{+195}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.22 \cdot 10^{-61}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-120}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+38}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.99999999999999982e195 or -2.1999999999999999e135 < x < -1.22e-61 or 3.6000000000000003e-120 < x < 2.40000000000000017e38Initial program 99.9%
Taylor expanded in x around inf 89.7%
Taylor expanded in t around 0 69.8%
distribute-lft-in69.8%
+-commutative69.8%
Simplified69.8%
if -7.99999999999999982e195 < x < -2.1999999999999999e135 or 2.40000000000000017e38 < x Initial program 100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in z around 0 81.0%
if -1.22e-61 < x < 3.6000000000000003e-120Initial program 99.8%
Taylor expanded in x around 0 64.9%
Final simplification70.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (* y 2.0))) (t_2 (* z (* x 2.0))))
(if (<= x -6.9e+152)
t_1
(if (<= x -3.3e-58)
t_2
(if (<= x 2.8e-121)
(* y 5.0)
(if (<= x 6.3e+38) t_2 (if (<= x 2.1e+184) (* x t) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y * 2.0);
double t_2 = z * (x * 2.0);
double tmp;
if (x <= -6.9e+152) {
tmp = t_1;
} else if (x <= -3.3e-58) {
tmp = t_2;
} else if (x <= 2.8e-121) {
tmp = y * 5.0;
} else if (x <= 6.3e+38) {
tmp = t_2;
} else if (x <= 2.1e+184) {
tmp = x * 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) :: t_2
real(8) :: tmp
t_1 = x * (y * 2.0d0)
t_2 = z * (x * 2.0d0)
if (x <= (-6.9d+152)) then
tmp = t_1
else if (x <= (-3.3d-58)) then
tmp = t_2
else if (x <= 2.8d-121) then
tmp = y * 5.0d0
else if (x <= 6.3d+38) then
tmp = t_2
else if (x <= 2.1d+184) then
tmp = x * 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 * 2.0);
double t_2 = z * (x * 2.0);
double tmp;
if (x <= -6.9e+152) {
tmp = t_1;
} else if (x <= -3.3e-58) {
tmp = t_2;
} else if (x <= 2.8e-121) {
tmp = y * 5.0;
} else if (x <= 6.3e+38) {
tmp = t_2;
} else if (x <= 2.1e+184) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y * 2.0) t_2 = z * (x * 2.0) tmp = 0 if x <= -6.9e+152: tmp = t_1 elif x <= -3.3e-58: tmp = t_2 elif x <= 2.8e-121: tmp = y * 5.0 elif x <= 6.3e+38: tmp = t_2 elif x <= 2.1e+184: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y * 2.0)) t_2 = Float64(z * Float64(x * 2.0)) tmp = 0.0 if (x <= -6.9e+152) tmp = t_1; elseif (x <= -3.3e-58) tmp = t_2; elseif (x <= 2.8e-121) tmp = Float64(y * 5.0); elseif (x <= 6.3e+38) tmp = t_2; elseif (x <= 2.1e+184) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y * 2.0); t_2 = z * (x * 2.0); tmp = 0.0; if (x <= -6.9e+152) tmp = t_1; elseif (x <= -3.3e-58) tmp = t_2; elseif (x <= 2.8e-121) tmp = y * 5.0; elseif (x <= 6.3e+38) tmp = t_2; elseif (x <= 2.1e+184) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.9e+152], t$95$1, If[LessEqual[x, -3.3e-58], t$95$2, If[LessEqual[x, 2.8e-121], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 6.3e+38], t$95$2, If[LessEqual[x, 2.1e+184], N[(x * t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot 2\right)\\
t_2 := z \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \leq -6.9 \cdot 10^{+152}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.3 \cdot 10^{-58}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-121}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 6.3 \cdot 10^{+38}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+184}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.9e152 or 2.1e184 < x Initial program 100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in y around inf 55.1%
associate-*r*55.1%
*-commutative55.1%
associate-*r*55.1%
Simplified55.1%
if -6.9e152 < x < -3.30000000000000026e-58 or 2.8000000000000001e-121 < x < 6.30000000000000003e38Initial program 99.9%
Taylor expanded in z around inf 52.0%
Simplified52.0%
if -3.30000000000000026e-58 < x < 2.8000000000000001e-121Initial program 99.8%
Taylor expanded in x around 0 64.9%
if 6.30000000000000003e38 < x < 2.1e184Initial program 100.0%
Taylor expanded in t around inf 60.0%
Final simplification58.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -1.08e+64)
t_1
(if (<= y -1.62e+32)
(* x (+ t (* y 2.0)))
(if (or (<= y -5.8e+15) (not (<= y 2.2e-9)))
t_1
(* x (+ t (* z 2.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.08e+64) {
tmp = t_1;
} else if (y <= -1.62e+32) {
tmp = x * (t + (y * 2.0));
} else if ((y <= -5.8e+15) || !(y <= 2.2e-9)) {
tmp = t_1;
} else {
tmp = x * (t + (z * 2.0));
}
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 * (5.0d0 + (x * 2.0d0))
if (y <= (-1.08d+64)) then
tmp = t_1
else if (y <= (-1.62d+32)) then
tmp = x * (t + (y * 2.0d0))
else if ((y <= (-5.8d+15)) .or. (.not. (y <= 2.2d-9))) then
tmp = t_1
else
tmp = x * (t + (z * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.08e+64) {
tmp = t_1;
} else if (y <= -1.62e+32) {
tmp = x * (t + (y * 2.0));
} else if ((y <= -5.8e+15) || !(y <= 2.2e-9)) {
tmp = t_1;
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -1.08e+64: tmp = t_1 elif y <= -1.62e+32: tmp = x * (t + (y * 2.0)) elif (y <= -5.8e+15) or not (y <= 2.2e-9): tmp = t_1 else: tmp = x * (t + (z * 2.0)) return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -1.08e+64) tmp = t_1; elseif (y <= -1.62e+32) tmp = Float64(x * Float64(t + Float64(y * 2.0))); elseif ((y <= -5.8e+15) || !(y <= 2.2e-9)) tmp = t_1; else tmp = Float64(x * Float64(t + Float64(z * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -1.08e+64) tmp = t_1; elseif (y <= -1.62e+32) tmp = x * (t + (y * 2.0)); elseif ((y <= -5.8e+15) || ~((y <= 2.2e-9))) tmp = t_1; else tmp = x * (t + (z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.08e+64], t$95$1, If[LessEqual[y, -1.62e+32], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -5.8e+15], N[Not[LessEqual[y, 2.2e-9]], $MachinePrecision]], t$95$1, N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.08 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.62 \cdot 10^{+32}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{elif}\;y \leq -5.8 \cdot 10^{+15} \lor \neg \left(y \leq 2.2 \cdot 10^{-9}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if y < -1.08000000000000007e64 or -1.62e32 < y < -5.8e15 or 2.1999999999999998e-9 < y Initial program 99.9%
Taylor expanded in y around inf 82.4%
Simplified82.4%
if -1.08000000000000007e64 < y < -1.62e32Initial program 100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in z around 0 78.0%
if -5.8e15 < y < 2.1999999999999998e-9Initial program 100.0%
Taylor expanded in y around 0 83.9%
Final simplification83.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (* (+ y z) 2.0))))
(if (<= x -1.3e-56)
t_1
(if (<= x 4e-120)
(* y 5.0)
(if (or (<= x 2.05e+39) (not (<= x 1e+137))) t_1 (* x t))))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y + z) * 2.0);
double tmp;
if (x <= -1.3e-56) {
tmp = t_1;
} else if (x <= 4e-120) {
tmp = y * 5.0;
} else if ((x <= 2.05e+39) || !(x <= 1e+137)) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = x * ((y + z) * 2.0d0)
if (x <= (-1.3d-56)) then
tmp = t_1
else if (x <= 4d-120) then
tmp = y * 5.0d0
else if ((x <= 2.05d+39) .or. (.not. (x <= 1d+137))) then
tmp = t_1
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y + z) * 2.0);
double tmp;
if (x <= -1.3e-56) {
tmp = t_1;
} else if (x <= 4e-120) {
tmp = y * 5.0;
} else if ((x <= 2.05e+39) || !(x <= 1e+137)) {
tmp = t_1;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y + z) * 2.0) tmp = 0 if x <= -1.3e-56: tmp = t_1 elif x <= 4e-120: tmp = y * 5.0 elif (x <= 2.05e+39) or not (x <= 1e+137): tmp = t_1 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y + z) * 2.0)) tmp = 0.0 if (x <= -1.3e-56) tmp = t_1; elseif (x <= 4e-120) tmp = Float64(y * 5.0); elseif ((x <= 2.05e+39) || !(x <= 1e+137)) tmp = t_1; else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y + z) * 2.0); tmp = 0.0; if (x <= -1.3e-56) tmp = t_1; elseif (x <= 4e-120) tmp = y * 5.0; elseif ((x <= 2.05e+39) || ~((x <= 1e+137))) tmp = t_1; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.3e-56], t$95$1, If[LessEqual[x, 4e-120], N[(y * 5.0), $MachinePrecision], If[Or[LessEqual[x, 2.05e+39], N[Not[LessEqual[x, 1e+137]], $MachinePrecision]], t$95$1, N[(x * t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -1.3 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-120}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+39} \lor \neg \left(x \leq 10^{+137}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -1.29999999999999998e-56 or 3.99999999999999991e-120 < x < 2.05000000000000002e39 or 1e137 < x Initial program 100.0%
Taylor expanded in x around inf 93.5%
Taylor expanded in t around 0 70.6%
distribute-lft-in70.6%
+-commutative70.6%
Simplified70.6%
if -1.29999999999999998e-56 < x < 3.99999999999999991e-120Initial program 99.8%
Taylor expanded in x around 0 64.9%
if 2.05000000000000002e39 < x < 1e137Initial program 100.0%
Taylor expanded in t around inf 62.2%
Final simplification67.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))))
(if (<= x -8.5e+184)
(* x (* (+ y z) 2.0))
(if (<= x -1.2e-148)
t_1
(if (<= x 1.65e-120)
(* y 5.0)
(if (<= x 3.9e+257) t_1 (* x (+ t (* y 2.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double tmp;
if (x <= -8.5e+184) {
tmp = x * ((y + z) * 2.0);
} else if (x <= -1.2e-148) {
tmp = t_1;
} else if (x <= 1.65e-120) {
tmp = y * 5.0;
} else if (x <= 3.9e+257) {
tmp = t_1;
} else {
tmp = x * (t + (y * 2.0));
}
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 * (t + (z * 2.0d0))
if (x <= (-8.5d+184)) then
tmp = x * ((y + z) * 2.0d0)
else if (x <= (-1.2d-148)) then
tmp = t_1
else if (x <= 1.65d-120) then
tmp = y * 5.0d0
else if (x <= 3.9d+257) then
tmp = t_1
else
tmp = x * (t + (y * 2.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double tmp;
if (x <= -8.5e+184) {
tmp = x * ((y + z) * 2.0);
} else if (x <= -1.2e-148) {
tmp = t_1;
} else if (x <= 1.65e-120) {
tmp = y * 5.0;
} else if (x <= 3.9e+257) {
tmp = t_1;
} else {
tmp = x * (t + (y * 2.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) tmp = 0 if x <= -8.5e+184: tmp = x * ((y + z) * 2.0) elif x <= -1.2e-148: tmp = t_1 elif x <= 1.65e-120: tmp = y * 5.0 elif x <= 3.9e+257: tmp = t_1 else: tmp = x * (t + (y * 2.0)) return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) tmp = 0.0 if (x <= -8.5e+184) tmp = Float64(x * Float64(Float64(y + z) * 2.0)); elseif (x <= -1.2e-148) tmp = t_1; elseif (x <= 1.65e-120) tmp = Float64(y * 5.0); elseif (x <= 3.9e+257) tmp = t_1; else tmp = Float64(x * Float64(t + Float64(y * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); tmp = 0.0; if (x <= -8.5e+184) tmp = x * ((y + z) * 2.0); elseif (x <= -1.2e-148) tmp = t_1; elseif (x <= 1.65e-120) tmp = y * 5.0; elseif (x <= 3.9e+257) tmp = t_1; else tmp = x * (t + (y * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.5e+184], N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.2e-148], t$95$1, If[LessEqual[x, 1.65e-120], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 3.9e+257], t$95$1, N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{+184}:\\
\;\;\;\;x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-148}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-120}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+257}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if x < -8.50000000000000043e184Initial program 100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in t around 0 95.0%
distribute-lft-in95.0%
+-commutative95.0%
Simplified95.0%
if -8.50000000000000043e184 < x < -1.2000000000000001e-148 or 1.64999999999999984e-120 < x < 3.90000000000000005e257Initial program 100.0%
Taylor expanded in y around 0 73.2%
if -1.2000000000000001e-148 < x < 1.64999999999999984e-120Initial program 99.8%
Taylor expanded in x around 0 69.9%
if 3.90000000000000005e257 < x Initial program 100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in z around 0 100.0%
Final simplification75.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (* y 2.0))))
(if (<= x -4.8e+189)
t_1
(if (<= x -1.25e-9)
(* x t)
(if (<= x 2.75e-46) (* y 5.0) (if (<= x 1.55e+184) (* x t) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y * 2.0);
double tmp;
if (x <= -4.8e+189) {
tmp = t_1;
} else if (x <= -1.25e-9) {
tmp = x * t;
} else if (x <= 2.75e-46) {
tmp = y * 5.0;
} else if (x <= 1.55e+184) {
tmp = x * 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 * 2.0d0)
if (x <= (-4.8d+189)) then
tmp = t_1
else if (x <= (-1.25d-9)) then
tmp = x * t
else if (x <= 2.75d-46) then
tmp = y * 5.0d0
else if (x <= 1.55d+184) then
tmp = x * 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 * 2.0);
double tmp;
if (x <= -4.8e+189) {
tmp = t_1;
} else if (x <= -1.25e-9) {
tmp = x * t;
} else if (x <= 2.75e-46) {
tmp = y * 5.0;
} else if (x <= 1.55e+184) {
tmp = x * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y * 2.0) tmp = 0 if x <= -4.8e+189: tmp = t_1 elif x <= -1.25e-9: tmp = x * t elif x <= 2.75e-46: tmp = y * 5.0 elif x <= 1.55e+184: tmp = x * t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y * 2.0)) tmp = 0.0 if (x <= -4.8e+189) tmp = t_1; elseif (x <= -1.25e-9) tmp = Float64(x * t); elseif (x <= 2.75e-46) tmp = Float64(y * 5.0); elseif (x <= 1.55e+184) tmp = Float64(x * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y * 2.0); tmp = 0.0; if (x <= -4.8e+189) tmp = t_1; elseif (x <= -1.25e-9) tmp = x * t; elseif (x <= 2.75e-46) tmp = y * 5.0; elseif (x <= 1.55e+184) tmp = x * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.8e+189], t$95$1, If[LessEqual[x, -1.25e-9], N[(x * t), $MachinePrecision], If[LessEqual[x, 2.75e-46], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 1.55e+184], N[(x * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot 2\right)\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+189}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.25 \cdot 10^{-9}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 2.75 \cdot 10^{-46}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{+184}:\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.8000000000000001e189 or 1.5499999999999999e184 < x Initial program 100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in y around inf 56.8%
associate-*r*56.8%
*-commutative56.8%
associate-*r*56.8%
Simplified56.8%
if -4.8000000000000001e189 < x < -1.25e-9 or 2.74999999999999992e-46 < x < 1.5499999999999999e184Initial program 100.0%
Taylor expanded in t around inf 42.3%
if -1.25e-9 < x < 2.74999999999999992e-46Initial program 99.8%
Taylor expanded in x around 0 58.4%
Final simplification52.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -25500000000.0) (not (<= x 2.5))) (* x (+ t (+ (* y 2.0) (* z 2.0)))) (+ (+ (* x (* z 2.0)) (* x t)) (* y 5.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -25500000000.0) || !(x <= 2.5)) {
tmp = x * (t + ((y * 2.0) + (z * 2.0)));
} else {
tmp = ((x * (z * 2.0)) + (x * t)) + (y * 5.0);
}
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 <= (-25500000000.0d0)) .or. (.not. (x <= 2.5d0))) then
tmp = x * (t + ((y * 2.0d0) + (z * 2.0d0)))
else
tmp = ((x * (z * 2.0d0)) + (x * t)) + (y * 5.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -25500000000.0) || !(x <= 2.5)) {
tmp = x * (t + ((y * 2.0) + (z * 2.0)));
} else {
tmp = ((x * (z * 2.0)) + (x * t)) + (y * 5.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -25500000000.0) or not (x <= 2.5): tmp = x * (t + ((y * 2.0) + (z * 2.0))) else: tmp = ((x * (z * 2.0)) + (x * t)) + (y * 5.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -25500000000.0) || !(x <= 2.5)) tmp = Float64(x * Float64(t + Float64(Float64(y * 2.0) + Float64(z * 2.0)))); else tmp = Float64(Float64(Float64(x * Float64(z * 2.0)) + Float64(x * t)) + Float64(y * 5.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -25500000000.0) || ~((x <= 2.5))) tmp = x * (t + ((y * 2.0) + (z * 2.0))); else tmp = ((x * (z * 2.0)) + (x * t)) + (y * 5.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -25500000000.0], N[Not[LessEqual[x, 2.5]], $MachinePrecision]], N[(x * N[(t + N[(N[(y * 2.0), $MachinePrecision] + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -25500000000 \lor \neg \left(x \leq 2.5\right):\\
\;\;\;\;x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(z \cdot 2\right) + x \cdot t\right) + y \cdot 5\\
\end{array}
\end{array}
if x < -2.55e10 or 2.5 < x Initial program 100.0%
Taylor expanded in x around inf 99.5%
if -2.55e10 < x < 2.5Initial program 99.8%
Taylor expanded in y around 0 99.3%
distribute-lft-in99.3%
*-commutative99.3%
Applied egg-rr99.3%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -25500000000.0) (not (<= x 2.5))) (* x (+ t (+ (* y 2.0) (* z 2.0)))) (+ (* y 5.0) (* x (+ t (* z 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -25500000000.0) || !(x <= 2.5)) {
tmp = x * (t + ((y * 2.0) + (z * 2.0)));
} else {
tmp = (y * 5.0) + (x * (t + (z * 2.0)));
}
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 <= (-25500000000.0d0)) .or. (.not. (x <= 2.5d0))) then
tmp = x * (t + ((y * 2.0d0) + (z * 2.0d0)))
else
tmp = (y * 5.0d0) + (x * (t + (z * 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -25500000000.0) || !(x <= 2.5)) {
tmp = x * (t + ((y * 2.0) + (z * 2.0)));
} else {
tmp = (y * 5.0) + (x * (t + (z * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -25500000000.0) or not (x <= 2.5): tmp = x * (t + ((y * 2.0) + (z * 2.0))) else: tmp = (y * 5.0) + (x * (t + (z * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -25500000000.0) || !(x <= 2.5)) tmp = Float64(x * Float64(t + Float64(Float64(y * 2.0) + Float64(z * 2.0)))); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(z * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -25500000000.0) || ~((x <= 2.5))) tmp = x * (t + ((y * 2.0) + (z * 2.0))); else tmp = (y * 5.0) + (x * (t + (z * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -25500000000.0], N[Not[LessEqual[x, 2.5]], $MachinePrecision]], N[(x * N[(t + N[(N[(y * 2.0), $MachinePrecision] + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -25500000000 \lor \neg \left(x \leq 2.5\right):\\
\;\;\;\;x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if x < -2.55e10 or 2.5 < x Initial program 100.0%
Taylor expanded in x around inf 99.5%
if -2.55e10 < x < 2.5Initial program 99.8%
Taylor expanded in y around 0 99.3%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.35e-69) (not (<= x 1.65e-120))) (* x (+ t (+ (* y 2.0) (* z 2.0)))) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.35e-69) || !(x <= 1.65e-120)) {
tmp = x * (t + ((y * 2.0) + (z * 2.0)));
} else {
tmp = (y * 5.0) + (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 ((x <= (-4.35d-69)) .or. (.not. (x <= 1.65d-120))) then
tmp = x * (t + ((y * 2.0d0) + (z * 2.0d0)))
else
tmp = (y * 5.0d0) + (x * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.35e-69) || !(x <= 1.65e-120)) {
tmp = x * (t + ((y * 2.0) + (z * 2.0)));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.35e-69) or not (x <= 1.65e-120): tmp = x * (t + ((y * 2.0) + (z * 2.0))) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.35e-69) || !(x <= 1.65e-120)) tmp = Float64(x * Float64(t + Float64(Float64(y * 2.0) + Float64(z * 2.0)))); else tmp = Float64(Float64(y * 5.0) + Float64(x * t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -4.35e-69) || ~((x <= 1.65e-120))) tmp = x * (t + ((y * 2.0) + (z * 2.0))); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.35e-69], N[Not[LessEqual[x, 1.65e-120]], $MachinePrecision]], N[(x * N[(t + N[(N[(y * 2.0), $MachinePrecision] + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.35 \cdot 10^{-69} \lor \neg \left(x \leq 1.65 \cdot 10^{-120}\right):\\
\;\;\;\;x \cdot \left(t + \left(y \cdot 2 + z \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -4.34999999999999976e-69 or 1.64999999999999984e-120 < x Initial program 100.0%
Taylor expanded in x around inf 94.2%
if -4.34999999999999976e-69 < x < 1.64999999999999984e-120Initial program 99.8%
Taylor expanded in y around 0 99.8%
Taylor expanded in z around 0 86.6%
Final simplification91.3%
(FPCore (x y z t) :precision binary64 (+ (* x (+ t (+ y (+ z (+ y z))))) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (y * 5.0);
}
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 + (y + z))))) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * (t + (y + (z + (y + z))))) + (y * 5.0);
}
def code(x, y, z, t): return (x * (t + (y + (z + (y + z))))) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(t + Float64(y + Float64(z + Float64(y + z))))) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * (t + (y + (z + (y + z))))) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(t + N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(t + \left(y + \left(z + \left(y + z\right)\right)\right)\right) + y \cdot 5
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -24000000000.0) (not (<= y 3.9e-141))) (* y 5.0) (* x t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -24000000000.0) || !(y <= 3.9e-141)) {
tmp = y * 5.0;
} else {
tmp = 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 <= (-24000000000.0d0)) .or. (.not. (y <= 3.9d-141))) then
tmp = y * 5.0d0
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -24000000000.0) || !(y <= 3.9e-141)) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -24000000000.0) or not (y <= 3.9e-141): tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -24000000000.0) || !(y <= 3.9e-141)) tmp = Float64(y * 5.0); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -24000000000.0) || ~((y <= 3.9e-141))) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -24000000000.0], N[Not[LessEqual[y, 3.9e-141]], $MachinePrecision]], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -24000000000 \lor \neg \left(y \leq 3.9 \cdot 10^{-141}\right):\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if y < -2.4e10 or 3.8999999999999997e-141 < y Initial program 99.9%
Taylor expanded in x around 0 47.5%
if -2.4e10 < y < 3.8999999999999997e-141Initial program 99.9%
Taylor expanded in t around inf 48.3%
Final simplification47.8%
(FPCore (x y z t) :precision binary64 (* y 5.0))
double code(double x, double y, double z, double t) {
return y * 5.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * 5.0d0
end function
public static double code(double x, double y, double z, double t) {
return y * 5.0;
}
def code(x, y, z, t): return y * 5.0
function code(x, y, z, t) return Float64(y * 5.0) end
function tmp = code(x, y, z, t) tmp = y * 5.0; end
code[x_, y_, z_, t_] := N[(y * 5.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 30.4%
Final simplification30.4%
herbie shell --seed 2024085
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
:precision binary64
(+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))