
(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 (fma (+ y z) 2.0 t))))
double code(double x, double y, double z, double t) {
return fma(y, 5.0, (x * fma((y + z), 2.0, t)));
}
function code(x, y, z, t) return fma(y, 5.0, Float64(x * fma(Float64(y + z), 2.0, t))) end
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(N[(y + z), $MachinePrecision] * 2.0 + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 5, x \cdot \mathsf{fma}\left(y + z, 2, t\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in96.9%
associate-+l+96.9%
+-commutative96.9%
count-296.9%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (fma x (+ t (* (+ y z) 2.0)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return fma(x, (t + ((y + z) * 2.0)), (y * 5.0));
}
function code(x, y, z, t) return fma(x, Float64(t + Float64(Float64(y + z) * 2.0)), Float64(y * 5.0)) end
code[x_, y_, z_, t_] := N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, t + \left(y + z\right) \cdot 2, y \cdot 5\right)
\end{array}
Initial program 99.9%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))) (t_2 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -1.22e+143)
t_2
(if (<= y -2e+76)
t_1
(if (<= y -1.75e+45)
(* y 5.0)
(if (<= y -1.1e-23)
(* (+ y z) (* x 2.0))
(if (or (<= y -2.5e-94) (and (not (<= y -2.4e-116)) (<= y 8e+94)))
t_1
t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + (z * 2.0));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.22e+143) {
tmp = t_2;
} else if (y <= -2e+76) {
tmp = t_1;
} else if (y <= -1.75e+45) {
tmp = y * 5.0;
} else if (y <= -1.1e-23) {
tmp = (y + z) * (x * 2.0);
} else if ((y <= -2.5e-94) || (!(y <= -2.4e-116) && (y <= 8e+94))) {
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 * (t + (z * 2.0d0))
t_2 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-1.22d+143)) then
tmp = t_2
else if (y <= (-2d+76)) then
tmp = t_1
else if (y <= (-1.75d+45)) then
tmp = y * 5.0d0
else if (y <= (-1.1d-23)) then
tmp = (y + z) * (x * 2.0d0)
else if ((y <= (-2.5d-94)) .or. (.not. (y <= (-2.4d-116))) .and. (y <= 8d+94)) 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 * (t + (z * 2.0));
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -1.22e+143) {
tmp = t_2;
} else if (y <= -2e+76) {
tmp = t_1;
} else if (y <= -1.75e+45) {
tmp = y * 5.0;
} else if (y <= -1.1e-23) {
tmp = (y + z) * (x * 2.0);
} else if ((y <= -2.5e-94) || (!(y <= -2.4e-116) && (y <= 8e+94))) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + (z * 2.0)) t_2 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -1.22e+143: tmp = t_2 elif y <= -2e+76: tmp = t_1 elif y <= -1.75e+45: tmp = y * 5.0 elif y <= -1.1e-23: tmp = (y + z) * (x * 2.0) elif (y <= -2.5e-94) or (not (y <= -2.4e-116) and (y <= 8e+94)): tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(z * 2.0))) t_2 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -1.22e+143) tmp = t_2; elseif (y <= -2e+76) tmp = t_1; elseif (y <= -1.75e+45) tmp = Float64(y * 5.0); elseif (y <= -1.1e-23) tmp = Float64(Float64(y + z) * Float64(x * 2.0)); elseif ((y <= -2.5e-94) || (!(y <= -2.4e-116) && (y <= 8e+94))) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + (z * 2.0)); t_2 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -1.22e+143) tmp = t_2; elseif (y <= -2e+76) tmp = t_1; elseif (y <= -1.75e+45) tmp = y * 5.0; elseif (y <= -1.1e-23) tmp = (y + z) * (x * 2.0); elseif ((y <= -2.5e-94) || (~((y <= -2.4e-116)) && (y <= 8e+94))) tmp = t_1; else tmp = t_2; 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]}, Block[{t$95$2 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.22e+143], t$95$2, If[LessEqual[y, -2e+76], t$95$1, If[LessEqual[y, -1.75e+45], N[(y * 5.0), $MachinePrecision], If[LessEqual[y, -1.1e-23], N[(N[(y + z), $MachinePrecision] * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, -2.5e-94], And[N[Not[LessEqual[y, -2.4e-116]], $MachinePrecision], LessEqual[y, 8e+94]]], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + z \cdot 2\right)\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -1.22 \cdot 10^{+143}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -2 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.75 \cdot 10^{+45}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-23}:\\
\;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-94} \lor \neg \left(y \leq -2.4 \cdot 10^{-116}\right) \land y \leq 8 \cdot 10^{+94}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -1.22000000000000004e143 or -2.4999999999999998e-94 < y < -2.39999999999999993e-116 or 8.0000000000000002e94 < y Initial program 99.9%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in y around inf 90.2%
if -1.22000000000000004e143 < y < -2.0000000000000001e76 or -1.1e-23 < y < -2.4999999999999998e-94 or -2.39999999999999993e-116 < y < 8.0000000000000002e94Initial program 99.9%
Taylor expanded in y around 0 81.2%
if -2.0000000000000001e76 < y < -1.75000000000000011e45Initial program 99.8%
Taylor expanded in x around 0 58.7%
if -1.75000000000000011e45 < y < -1.1e-23Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
associate-*r*100.0%
fma-def100.0%
*-commutative100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 91.8%
*-commutative91.8%
associate-*r*91.8%
+-commutative91.8%
Simplified91.8%
Final simplification83.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* y 5.0) (* 2.0 (* x z))))
(t_2 (* x (+ t (* (+ y z) 2.0))))
(t_3 (+ (* y 5.0) (* x t))))
(if (<= x -5.2e-14)
t_2
(if (<= x -2.45e-86)
t_1
(if (<= x -5.8e-250)
t_3
(if (<= x 5.4e-157)
t_1
(if (<= x 2.5e-107) t_3 (if (<= x 3.8e-47) 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 = x * (t + ((y + z) * 2.0));
double t_3 = (y * 5.0) + (x * t);
double tmp;
if (x <= -5.2e-14) {
tmp = t_2;
} else if (x <= -2.45e-86) {
tmp = t_1;
} else if (x <= -5.8e-250) {
tmp = t_3;
} else if (x <= 5.4e-157) {
tmp = t_1;
} else if (x <= 2.5e-107) {
tmp = t_3;
} else if (x <= 3.8e-47) {
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 = (y * 5.0d0) + (2.0d0 * (x * z))
t_2 = x * (t + ((y + z) * 2.0d0))
t_3 = (y * 5.0d0) + (x * t)
if (x <= (-5.2d-14)) then
tmp = t_2
else if (x <= (-2.45d-86)) then
tmp = t_1
else if (x <= (-5.8d-250)) then
tmp = t_3
else if (x <= 5.4d-157) then
tmp = t_1
else if (x <= 2.5d-107) then
tmp = t_3
else if (x <= 3.8d-47) 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 = x * (t + ((y + z) * 2.0));
double t_3 = (y * 5.0) + (x * t);
double tmp;
if (x <= -5.2e-14) {
tmp = t_2;
} else if (x <= -2.45e-86) {
tmp = t_1;
} else if (x <= -5.8e-250) {
tmp = t_3;
} else if (x <= 5.4e-157) {
tmp = t_1;
} else if (x <= 2.5e-107) {
tmp = t_3;
} else if (x <= 3.8e-47) {
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 = x * (t + ((y + z) * 2.0)) t_3 = (y * 5.0) + (x * t) tmp = 0 if x <= -5.2e-14: tmp = t_2 elif x <= -2.45e-86: tmp = t_1 elif x <= -5.8e-250: tmp = t_3 elif x <= 5.4e-157: tmp = t_1 elif x <= 2.5e-107: tmp = t_3 elif x <= 3.8e-47: 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(x * Float64(t + Float64(Float64(y + z) * 2.0))) t_3 = Float64(Float64(y * 5.0) + Float64(x * t)) tmp = 0.0 if (x <= -5.2e-14) tmp = t_2; elseif (x <= -2.45e-86) tmp = t_1; elseif (x <= -5.8e-250) tmp = t_3; elseif (x <= 5.4e-157) tmp = t_1; elseif (x <= 2.5e-107) tmp = t_3; elseif (x <= 3.8e-47) 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 = x * (t + ((y + z) * 2.0)); t_3 = (y * 5.0) + (x * t); tmp = 0.0; if (x <= -5.2e-14) tmp = t_2; elseif (x <= -2.45e-86) tmp = t_1; elseif (x <= -5.8e-250) tmp = t_3; elseif (x <= 5.4e-157) tmp = t_1; elseif (x <= 2.5e-107) tmp = t_3; elseif (x <= 3.8e-47) 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[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.2e-14], t$95$2, If[LessEqual[x, -2.45e-86], t$95$1, If[LessEqual[x, -5.8e-250], t$95$3, If[LessEqual[x, 5.4e-157], t$95$1, If[LessEqual[x, 2.5e-107], t$95$3, If[LessEqual[x, 3.8e-47], 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 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
t_3 := y \cdot 5 + x \cdot t\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{-14}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.45 \cdot 10^{-86}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-250}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-157}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-107}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -5.19999999999999993e-14 or 3.80000000000000015e-47 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 98.6%
if -5.19999999999999993e-14 < x < -2.44999999999999986e-86 or -5.8000000000000004e-250 < x < 5.4e-157 or 2.49999999999999985e-107 < x < 3.80000000000000015e-47Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in t around 0 88.6%
Taylor expanded in y around 0 88.6%
if -2.44999999999999986e-86 < x < -5.8000000000000004e-250 or 5.4e-157 < x < 2.49999999999999985e-107Initial program 99.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 88.1%
fma-udef88.1%
*-commutative88.1%
Applied egg-rr88.1%
Final simplification93.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (+ 5.0 (* x 2.0))))
(t_2 (* x (+ t (* y 2.0))))
(t_3 (* (+ y z) (* x 2.0))))
(if (<= z -5.7e+69)
t_3
(if (<= z -3e+20)
t_1
(if (<= z -1.3e-172)
t_2
(if (<= z -6.2e-246)
t_1
(if (<= z -3.8e-276) t_2 (if (<= z 4.2e+92) t_1 t_3))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (5.0 + (x * 2.0));
double t_2 = x * (t + (y * 2.0));
double t_3 = (y + z) * (x * 2.0);
double tmp;
if (z <= -5.7e+69) {
tmp = t_3;
} else if (z <= -3e+20) {
tmp = t_1;
} else if (z <= -1.3e-172) {
tmp = t_2;
} else if (z <= -6.2e-246) {
tmp = t_1;
} else if (z <= -3.8e-276) {
tmp = t_2;
} else if (z <= 4.2e+92) {
tmp = t_1;
} else {
tmp = t_3;
}
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 = y * (5.0d0 + (x * 2.0d0))
t_2 = x * (t + (y * 2.0d0))
t_3 = (y + z) * (x * 2.0d0)
if (z <= (-5.7d+69)) then
tmp = t_3
else if (z <= (-3d+20)) then
tmp = t_1
else if (z <= (-1.3d-172)) then
tmp = t_2
else if (z <= (-6.2d-246)) then
tmp = t_1
else if (z <= (-3.8d-276)) then
tmp = t_2
else if (z <= 4.2d+92) then
tmp = t_1
else
tmp = t_3
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 t_2 = x * (t + (y * 2.0));
double t_3 = (y + z) * (x * 2.0);
double tmp;
if (z <= -5.7e+69) {
tmp = t_3;
} else if (z <= -3e+20) {
tmp = t_1;
} else if (z <= -1.3e-172) {
tmp = t_2;
} else if (z <= -6.2e-246) {
tmp = t_1;
} else if (z <= -3.8e-276) {
tmp = t_2;
} else if (z <= 4.2e+92) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (5.0 + (x * 2.0)) t_2 = x * (t + (y * 2.0)) t_3 = (y + z) * (x * 2.0) tmp = 0 if z <= -5.7e+69: tmp = t_3 elif z <= -3e+20: tmp = t_1 elif z <= -1.3e-172: tmp = t_2 elif z <= -6.2e-246: tmp = t_1 elif z <= -3.8e-276: tmp = t_2 elif z <= 4.2e+92: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(5.0 + Float64(x * 2.0))) t_2 = Float64(x * Float64(t + Float64(y * 2.0))) t_3 = Float64(Float64(y + z) * Float64(x * 2.0)) tmp = 0.0 if (z <= -5.7e+69) tmp = t_3; elseif (z <= -3e+20) tmp = t_1; elseif (z <= -1.3e-172) tmp = t_2; elseif (z <= -6.2e-246) tmp = t_1; elseif (z <= -3.8e-276) tmp = t_2; elseif (z <= 4.2e+92) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (5.0 + (x * 2.0)); t_2 = x * (t + (y * 2.0)); t_3 = (y + z) * (x * 2.0); tmp = 0.0; if (z <= -5.7e+69) tmp = t_3; elseif (z <= -3e+20) tmp = t_1; elseif (z <= -1.3e-172) tmp = t_2; elseif (z <= -6.2e-246) tmp = t_1; elseif (z <= -3.8e-276) tmp = t_2; elseif (z <= 4.2e+92) tmp = t_1; else tmp = t_3; 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]}, Block[{t$95$2 = N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y + z), $MachinePrecision] * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.7e+69], t$95$3, If[LessEqual[z, -3e+20], t$95$1, If[LessEqual[z, -1.3e-172], t$95$2, If[LessEqual[z, -6.2e-246], t$95$1, If[LessEqual[z, -3.8e-276], t$95$2, If[LessEqual[z, 4.2e+92], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(5 + x \cdot 2\right)\\
t_2 := x \cdot \left(t + y \cdot 2\right)\\
t_3 := \left(y + z\right) \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;z \leq -5.7 \cdot 10^{+69}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -3 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-172}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-246}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-276}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+92}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -5.7e69 or 4.19999999999999972e92 < z Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around 0 91.1%
associate-*r*91.1%
fma-def91.1%
*-commutative91.1%
*-commutative91.1%
Applied egg-rr91.1%
Taylor expanded in x around inf 75.0%
*-commutative75.0%
associate-*r*75.0%
+-commutative75.0%
Simplified75.0%
if -5.7e69 < z < -3e20 or -1.2999999999999999e-172 < z < -6.2000000000000001e-246 or -3.8e-276 < z < 4.19999999999999972e92Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in y around inf 65.4%
if -3e20 < z < -1.2999999999999999e-172 or -6.2000000000000001e-246 < z < -3.8e-276Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in z around 0 90.2%
Taylor expanded in x around inf 69.4%
Final simplification69.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* y 5.0) (* x t))) (t_2 (* y (+ 5.0 (* x 2.0)))))
(if (<= y -9e+145)
t_2
(if (<= y -1.26e+45)
t_1
(if (<= y -1.05e-31)
(* (+ y z) (* x 2.0))
(if (<= y -2.4e-116)
t_1
(if (<= y 1.4e+94) (* x (+ t (* z 2.0))) t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (x * t);
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -9e+145) {
tmp = t_2;
} else if (y <= -1.26e+45) {
tmp = t_1;
} else if (y <= -1.05e-31) {
tmp = (y + z) * (x * 2.0);
} else if (y <= -2.4e-116) {
tmp = t_1;
} else if (y <= 1.4e+94) {
tmp = x * (t + (z * 2.0));
} 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) + (x * t)
t_2 = y * (5.0d0 + (x * 2.0d0))
if (y <= (-9d+145)) then
tmp = t_2
else if (y <= (-1.26d+45)) then
tmp = t_1
else if (y <= (-1.05d-31)) then
tmp = (y + z) * (x * 2.0d0)
else if (y <= (-2.4d-116)) then
tmp = t_1
else if (y <= 1.4d+94) then
tmp = x * (t + (z * 2.0d0))
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) + (x * t);
double t_2 = y * (5.0 + (x * 2.0));
double tmp;
if (y <= -9e+145) {
tmp = t_2;
} else if (y <= -1.26e+45) {
tmp = t_1;
} else if (y <= -1.05e-31) {
tmp = (y + z) * (x * 2.0);
} else if (y <= -2.4e-116) {
tmp = t_1;
} else if (y <= 1.4e+94) {
tmp = x * (t + (z * 2.0));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * 5.0) + (x * t) t_2 = y * (5.0 + (x * 2.0)) tmp = 0 if y <= -9e+145: tmp = t_2 elif y <= -1.26e+45: tmp = t_1 elif y <= -1.05e-31: tmp = (y + z) * (x * 2.0) elif y <= -2.4e-116: tmp = t_1 elif y <= 1.4e+94: tmp = x * (t + (z * 2.0)) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * 5.0) + Float64(x * t)) t_2 = Float64(y * Float64(5.0 + Float64(x * 2.0))) tmp = 0.0 if (y <= -9e+145) tmp = t_2; elseif (y <= -1.26e+45) tmp = t_1; elseif (y <= -1.05e-31) tmp = Float64(Float64(y + z) * Float64(x * 2.0)); elseif (y <= -2.4e-116) tmp = t_1; elseif (y <= 1.4e+94) tmp = Float64(x * Float64(t + Float64(z * 2.0))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * 5.0) + (x * t); t_2 = y * (5.0 + (x * 2.0)); tmp = 0.0; if (y <= -9e+145) tmp = t_2; elseif (y <= -1.26e+45) tmp = t_1; elseif (y <= -1.05e-31) tmp = (y + z) * (x * 2.0); elseif (y <= -2.4e-116) tmp = t_1; elseif (y <= 1.4e+94) tmp = x * (t + (z * 2.0)); 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[(x * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e+145], t$95$2, If[LessEqual[y, -1.26e+45], t$95$1, If[LessEqual[y, -1.05e-31], N[(N[(y + z), $MachinePrecision] * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.4e-116], t$95$1, If[LessEqual[y, 1.4e+94], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot 5 + x \cdot t\\
t_2 := y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{if}\;y \leq -9 \cdot 10^{+145}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -1.26 \cdot 10^{+45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-31}:\\
\;\;\;\;\left(y + z\right) \cdot \left(x \cdot 2\right)\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-116}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+94}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y < -8.9999999999999996e145 or 1.39999999999999999e94 < y Initial program 99.9%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in y around inf 89.5%
if -8.9999999999999996e145 < y < -1.26e45 or -1.04999999999999996e-31 < y < -2.39999999999999993e-116Initial program 99.8%
+-commutative99.8%
fma-def100.0%
distribute-rgt-in97.5%
associate-+l+97.5%
+-commutative97.5%
count-297.5%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 76.2%
fma-udef76.1%
*-commutative76.1%
Applied egg-rr76.1%
if -1.26e45 < y < -1.04999999999999996e-31Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
associate-*r*100.0%
fma-def100.0%
*-commutative100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 92.5%
*-commutative92.5%
associate-*r*92.5%
+-commutative92.5%
Simplified92.5%
if -2.39999999999999993e-116 < y < 1.39999999999999999e94Initial program 100.0%
Taylor expanded in y around 0 83.1%
Final simplification84.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 2.0 (* x z))))
(if (<= x -1.15e+268)
(* 2.0 (* y x))
(if (<= x -1.6e+160)
t_1
(if (<= x -3.25e-13)
(* x t)
(if (<= x 3.8e-36) (* y 5.0) (if (<= x 6.6e+168) t_1 (* x t))))))))
double code(double x, double y, double z, double t) {
double t_1 = 2.0 * (x * z);
double tmp;
if (x <= -1.15e+268) {
tmp = 2.0 * (y * x);
} else if (x <= -1.6e+160) {
tmp = t_1;
} else if (x <= -3.25e-13) {
tmp = x * t;
} else if (x <= 3.8e-36) {
tmp = y * 5.0;
} else if (x <= 6.6e+168) {
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 = 2.0d0 * (x * z)
if (x <= (-1.15d+268)) then
tmp = 2.0d0 * (y * x)
else if (x <= (-1.6d+160)) then
tmp = t_1
else if (x <= (-3.25d-13)) then
tmp = x * t
else if (x <= 3.8d-36) then
tmp = y * 5.0d0
else if (x <= 6.6d+168) 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 = 2.0 * (x * z);
double tmp;
if (x <= -1.15e+268) {
tmp = 2.0 * (y * x);
} else if (x <= -1.6e+160) {
tmp = t_1;
} else if (x <= -3.25e-13) {
tmp = x * t;
} else if (x <= 3.8e-36) {
tmp = y * 5.0;
} else if (x <= 6.6e+168) {
tmp = t_1;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): t_1 = 2.0 * (x * z) tmp = 0 if x <= -1.15e+268: tmp = 2.0 * (y * x) elif x <= -1.6e+160: tmp = t_1 elif x <= -3.25e-13: tmp = x * t elif x <= 3.8e-36: tmp = y * 5.0 elif x <= 6.6e+168: tmp = t_1 else: tmp = x * t return tmp
function code(x, y, z, t) t_1 = Float64(2.0 * Float64(x * z)) tmp = 0.0 if (x <= -1.15e+268) tmp = Float64(2.0 * Float64(y * x)); elseif (x <= -1.6e+160) tmp = t_1; elseif (x <= -3.25e-13) tmp = Float64(x * t); elseif (x <= 3.8e-36) tmp = Float64(y * 5.0); elseif (x <= 6.6e+168) tmp = t_1; else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 2.0 * (x * z); tmp = 0.0; if (x <= -1.15e+268) tmp = 2.0 * (y * x); elseif (x <= -1.6e+160) tmp = t_1; elseif (x <= -3.25e-13) tmp = x * t; elseif (x <= 3.8e-36) tmp = y * 5.0; elseif (x <= 6.6e+168) tmp = t_1; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e+268], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.6e+160], t$95$1, If[LessEqual[x, -3.25e-13], N[(x * t), $MachinePrecision], If[LessEqual[x, 3.8e-36], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 6.6e+168], t$95$1, N[(x * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+268}:\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{+160}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.25 \cdot 10^{-13}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-36}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{+168}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -1.15000000000000006e268Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in y around inf 55.9%
if -1.15000000000000006e268 < x < -1.5999999999999999e160 or 3.79999999999999971e-36 < x < 6.5999999999999997e168Initial program 100.0%
Taylor expanded in z around inf 58.6%
if -1.5999999999999999e160 < x < -3.24999999999999978e-13 or 6.5999999999999997e168 < x Initial program 100.0%
Taylor expanded in t around inf 48.7%
if -3.24999999999999978e-13 < x < 3.79999999999999971e-36Initial program 99.9%
Taylor expanded in x around 0 57.0%
Final simplification55.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* y 5.0) (* x t))))
(if (<= t -3e+72)
t_1
(if (<= t 3.3e+94)
(+ (* y 5.0) (* 2.0 (* x (+ y z))))
(if (or (<= t 8.8e+137) (not (<= t 1.2e+186)))
t_1
(* x (+ t (* z 2.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * 5.0) + (x * t);
double tmp;
if (t <= -3e+72) {
tmp = t_1;
} else if (t <= 3.3e+94) {
tmp = (y * 5.0) + (2.0 * (x * (y + z)));
} else if ((t <= 8.8e+137) || !(t <= 1.2e+186)) {
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 * t)
if (t <= (-3d+72)) then
tmp = t_1
else if (t <= 3.3d+94) then
tmp = (y * 5.0d0) + (2.0d0 * (x * (y + z)))
else if ((t <= 8.8d+137) .or. (.not. (t <= 1.2d+186))) 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 * t);
double tmp;
if (t <= -3e+72) {
tmp = t_1;
} else if (t <= 3.3e+94) {
tmp = (y * 5.0) + (2.0 * (x * (y + z)));
} else if ((t <= 8.8e+137) || !(t <= 1.2e+186)) {
tmp = t_1;
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * 5.0) + (x * t) tmp = 0 if t <= -3e+72: tmp = t_1 elif t <= 3.3e+94: tmp = (y * 5.0) + (2.0 * (x * (y + z))) elif (t <= 8.8e+137) or not (t <= 1.2e+186): tmp = t_1 else: tmp = x * (t + (z * 2.0)) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * 5.0) + Float64(x * t)) tmp = 0.0 if (t <= -3e+72) tmp = t_1; elseif (t <= 3.3e+94) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * Float64(y + z)))); elseif ((t <= 8.8e+137) || !(t <= 1.2e+186)) 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 * t); tmp = 0.0; if (t <= -3e+72) tmp = t_1; elseif (t <= 3.3e+94) tmp = (y * 5.0) + (2.0 * (x * (y + z))); elseif ((t <= 8.8e+137) || ~((t <= 1.2e+186))) 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[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3e+72], t$95$1, If[LessEqual[t, 3.3e+94], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 8.8e+137], N[Not[LessEqual[t, 1.2e+186]], $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 5 + x \cdot t\\
\mathbf{if}\;t \leq -3 \cdot 10^{+72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{+94}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{+137} \lor \neg \left(t \leq 1.2 \cdot 10^{+186}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if t < -3.00000000000000003e72 or 3.3e94 < t < 8.80000000000000062e137 or 1.19999999999999998e186 < t Initial program 99.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in92.3%
associate-+l+92.3%
+-commutative92.3%
count-292.3%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 92.4%
fma-udef92.4%
*-commutative92.4%
Applied egg-rr92.4%
if -3.00000000000000003e72 < t < 3.3e94Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around 0 91.5%
if 8.80000000000000062e137 < t < 1.19999999999999998e186Initial program 100.0%
Taylor expanded in y around 0 100.0%
Final simplification92.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (+ y z) (* x 2.0))))
(if (<= x -4.1e+15)
t_1
(if (<= x -1.5e-30)
(* x t)
(if (<= x -5e-49)
(* 2.0 (* x z))
(if (<= x 1.05e-35) (* y 5.0) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (y + z) * (x * 2.0);
double tmp;
if (x <= -4.1e+15) {
tmp = t_1;
} else if (x <= -1.5e-30) {
tmp = x * t;
} else if (x <= -5e-49) {
tmp = 2.0 * (x * z);
} else if (x <= 1.05e-35) {
tmp = y * 5.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 + z) * (x * 2.0d0)
if (x <= (-4.1d+15)) then
tmp = t_1
else if (x <= (-1.5d-30)) then
tmp = x * t
else if (x <= (-5d-49)) then
tmp = 2.0d0 * (x * z)
else if (x <= 1.05d-35) then
tmp = y * 5.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 + z) * (x * 2.0);
double tmp;
if (x <= -4.1e+15) {
tmp = t_1;
} else if (x <= -1.5e-30) {
tmp = x * t;
} else if (x <= -5e-49) {
tmp = 2.0 * (x * z);
} else if (x <= 1.05e-35) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y + z) * (x * 2.0) tmp = 0 if x <= -4.1e+15: tmp = t_1 elif x <= -1.5e-30: tmp = x * t elif x <= -5e-49: tmp = 2.0 * (x * z) elif x <= 1.05e-35: tmp = y * 5.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y + z) * Float64(x * 2.0)) tmp = 0.0 if (x <= -4.1e+15) tmp = t_1; elseif (x <= -1.5e-30) tmp = Float64(x * t); elseif (x <= -5e-49) tmp = Float64(2.0 * Float64(x * z)); elseif (x <= 1.05e-35) tmp = Float64(y * 5.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y + z) * (x * 2.0); tmp = 0.0; if (x <= -4.1e+15) tmp = t_1; elseif (x <= -1.5e-30) tmp = x * t; elseif (x <= -5e-49) tmp = 2.0 * (x * z); elseif (x <= 1.05e-35) tmp = y * 5.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y + z), $MachinePrecision] * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.1e+15], t$95$1, If[LessEqual[x, -1.5e-30], N[(x * t), $MachinePrecision], If[LessEqual[x, -5e-49], N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e-35], N[(y * 5.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + z\right) \cdot \left(x \cdot 2\right)\\
\mathbf{if}\;x \leq -4.1 \cdot 10^{+15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{-30}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-49}:\\
\;\;\;\;2 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-35}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -4.1e15 or 1.05e-35 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around 0 72.8%
associate-*r*72.8%
fma-def72.8%
*-commutative72.8%
*-commutative72.8%
Applied egg-rr72.8%
Taylor expanded in x around inf 72.1%
*-commutative72.1%
associate-*r*72.1%
+-commutative72.1%
Simplified72.1%
if -4.1e15 < x < -1.49999999999999995e-30Initial program 100.0%
Taylor expanded in t around inf 72.5%
if -1.49999999999999995e-30 < x < -4.9999999999999999e-49Initial program 99.5%
Taylor expanded in z around inf 90.4%
if -4.9999999999999999e-49 < x < 1.05e-35Initial program 99.9%
Taylor expanded in x around 0 58.6%
Final simplification65.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -3.7e+71)
(* x (+ t (* (+ y z) 2.0)))
(if (<= z 6.8e+83)
(+ (* x (+ t (* y 2.0))) (* y 5.0))
(+ (* y 5.0) (* 2.0 (* x (+ y z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e+71) {
tmp = x * (t + ((y + z) * 2.0));
} else if (z <= 6.8e+83) {
tmp = (x * (t + (y * 2.0))) + (y * 5.0);
} else {
tmp = (y * 5.0) + (2.0 * (x * (y + 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) :: tmp
if (z <= (-3.7d+71)) then
tmp = x * (t + ((y + z) * 2.0d0))
else if (z <= 6.8d+83) then
tmp = (x * (t + (y * 2.0d0))) + (y * 5.0d0)
else
tmp = (y * 5.0d0) + (2.0d0 * (x * (y + z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.7e+71) {
tmp = x * (t + ((y + z) * 2.0));
} else if (z <= 6.8e+83) {
tmp = (x * (t + (y * 2.0))) + (y * 5.0);
} else {
tmp = (y * 5.0) + (2.0 * (x * (y + z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.7e+71: tmp = x * (t + ((y + z) * 2.0)) elif z <= 6.8e+83: tmp = (x * (t + (y * 2.0))) + (y * 5.0) else: tmp = (y * 5.0) + (2.0 * (x * (y + z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.7e+71) tmp = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))); elseif (z <= 6.8e+83) tmp = Float64(Float64(x * Float64(t + Float64(y * 2.0))) + Float64(y * 5.0)); else tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * Float64(y + z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.7e+71) tmp = x * (t + ((y + z) * 2.0)); elseif (z <= 6.8e+83) tmp = (x * (t + (y * 2.0))) + (y * 5.0); else tmp = (y * 5.0) + (2.0 * (x * (y + z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.7e+71], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+83], N[(N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+71}:\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+83}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right) + y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot \left(y + z\right)\right)\\
\end{array}
\end{array}
if z < -3.7e71Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 88.0%
if -3.7e71 < z < 6.7999999999999996e83Initial program 99.9%
fma-def99.9%
associate-+l+99.9%
+-commutative99.9%
count-299.9%
Simplified99.9%
Taylor expanded in z around 0 91.4%
if 6.7999999999999996e83 < z Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in t around 0 97.5%
Final simplification91.6%
(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 (<= x -8.5e-51) (not (<= x 1.3e-35))) (* x (+ t (* (+ y z) 2.0))) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8.5e-51) || !(x <= 1.3e-35)) {
tmp = x * (t + ((y + 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 <= (-8.5d-51)) .or. (.not. (x <= 1.3d-35))) then
tmp = x * (t + ((y + 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 <= -8.5e-51) || !(x <= 1.3e-35)) {
tmp = x * (t + ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -8.5e-51) or not (x <= 1.3e-35): tmp = x * (t + ((y + z) * 2.0)) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -8.5e-51) || !(x <= 1.3e-35)) tmp = Float64(x * Float64(t + Float64(Float64(y + 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 <= -8.5e-51) || ~((x <= 1.3e-35))) tmp = x * (t + ((y + z) * 2.0)); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -8.5e-51], N[Not[LessEqual[x, 1.3e-35]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{-51} \lor \neg \left(x \leq 1.3 \cdot 10^{-35}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if x < -8.50000000000000036e-51 or 1.30000000000000002e-35 < x Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 97.7%
if -8.50000000000000036e-51 < x < 1.30000000000000002e-35Initial program 99.9%
+-commutative99.9%
fma-def100.0%
distribute-rgt-in100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
distribute-rgt-in100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in t around inf 78.3%
fma-udef78.3%
*-commutative78.3%
Applied egg-rr78.3%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (if (<= x -5e-15) (* x t) (if (<= x 1.45e-47) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5e-15) {
tmp = x * t;
} else if (x <= 1.45e-47) {
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 (x <= (-5d-15)) then
tmp = x * t
else if (x <= 1.45d-47) 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 (x <= -5e-15) {
tmp = x * t;
} else if (x <= 1.45e-47) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5e-15: tmp = x * t elif x <= 1.45e-47: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5e-15) tmp = Float64(x * t); elseif (x <= 1.45e-47) 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 (x <= -5e-15) tmp = x * t; elseif (x <= 1.45e-47) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5e-15], N[(x * t), $MachinePrecision], If[LessEqual[x, 1.45e-47], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{-15}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-47}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -4.99999999999999999e-15 or 1.45e-47 < x Initial program 100.0%
Taylor expanded in t around inf 38.8%
if -4.99999999999999999e-15 < x < 1.45e-47Initial program 99.9%
Taylor expanded in x around 0 57.5%
Final simplification48.1%
(FPCore (x y z t) :precision binary64 (if (<= x -300000.0) (* 2.0 (* y x)) (if (<= x 6e-50) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -300000.0) {
tmp = 2.0 * (y * x);
} else if (x <= 6e-50) {
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 (x <= (-300000.0d0)) then
tmp = 2.0d0 * (y * x)
else if (x <= 6d-50) 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 (x <= -300000.0) {
tmp = 2.0 * (y * x);
} else if (x <= 6e-50) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -300000.0: tmp = 2.0 * (y * x) elif x <= 6e-50: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -300000.0) tmp = Float64(2.0 * Float64(y * x)); elseif (x <= 6e-50) 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 (x <= -300000.0) tmp = 2.0 * (y * x); elseif (x <= 6e-50) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -300000.0], N[(2.0 * N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e-50], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -300000:\\
\;\;\;\;2 \cdot \left(y \cdot x\right)\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-50}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -3e5Initial program 100.0%
fma-def100.0%
associate-+l+100.0%
+-commutative100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in y around inf 40.1%
if -3e5 < x < 5.99999999999999981e-50Initial program 99.9%
Taylor expanded in x around 0 56.2%
if 5.99999999999999981e-50 < x Initial program 100.0%
Taylor expanded in t around inf 41.9%
Final simplification48.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.5%
Final simplification30.5%
herbie shell --seed 2023279
(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)))