
(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 (+ t (* (+ y z) 2.0)))))
double code(double x, double y, double z, double t) {
return fma(y, 5.0, (x * (t + ((y + z) * 2.0))));
}
function code(x, y, z, t) return fma(y, 5.0, Float64(x * Float64(t + Float64(Float64(y + z) * 2.0)))) end
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(y + z\right) \cdot 2\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%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (+ y z) 2.0)) (t_2 (* x (+ t t_1))))
(if (<= x -3.9e+31)
t_2
(if (<= x 1.04e-209)
(+ (* y (+ 5.0 (* x 2.0))) (* x t))
(if (<= x 1.9e-9) (+ (* y 5.0) (* x t_1)) t_2)))))
double code(double x, double y, double z, double t) {
double t_1 = (y + z) * 2.0;
double t_2 = x * (t + t_1);
double tmp;
if (x <= -3.9e+31) {
tmp = t_2;
} else if (x <= 1.04e-209) {
tmp = (y * (5.0 + (x * 2.0))) + (x * t);
} else if (x <= 1.9e-9) {
tmp = (y * 5.0) + (x * 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 + z) * 2.0d0
t_2 = x * (t + t_1)
if (x <= (-3.9d+31)) then
tmp = t_2
else if (x <= 1.04d-209) then
tmp = (y * (5.0d0 + (x * 2.0d0))) + (x * t)
else if (x <= 1.9d-9) then
tmp = (y * 5.0d0) + (x * 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 + z) * 2.0;
double t_2 = x * (t + t_1);
double tmp;
if (x <= -3.9e+31) {
tmp = t_2;
} else if (x <= 1.04e-209) {
tmp = (y * (5.0 + (x * 2.0))) + (x * t);
} else if (x <= 1.9e-9) {
tmp = (y * 5.0) + (x * t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y + z) * 2.0 t_2 = x * (t + t_1) tmp = 0 if x <= -3.9e+31: tmp = t_2 elif x <= 1.04e-209: tmp = (y * (5.0 + (x * 2.0))) + (x * t) elif x <= 1.9e-9: tmp = (y * 5.0) + (x * t_1) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y + z) * 2.0) t_2 = Float64(x * Float64(t + t_1)) tmp = 0.0 if (x <= -3.9e+31) tmp = t_2; elseif (x <= 1.04e-209) tmp = Float64(Float64(y * Float64(5.0 + Float64(x * 2.0))) + Float64(x * t)); elseif (x <= 1.9e-9) tmp = Float64(Float64(y * 5.0) + Float64(x * t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y + z) * 2.0; t_2 = x * (t + t_1); tmp = 0.0; if (x <= -3.9e+31) tmp = t_2; elseif (x <= 1.04e-209) tmp = (y * (5.0 + (x * 2.0))) + (x * t); elseif (x <= 1.9e-9) tmp = (y * 5.0) + (x * t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e+31], t$95$2, If[LessEqual[x, 1.04e-209], N[(N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.9e-9], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + z\right) \cdot 2\\
t_2 := x \cdot \left(t + t\_1\right)\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{+31}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.04 \cdot 10^{-209}:\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right) + x \cdot t\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-9}:\\
\;\;\;\;y \cdot 5 + x \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -3.89999999999999999e31 or 1.90000000000000006e-9 < x Initial program 100.0%
+-commutative100.0%
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%
Taylor expanded in x around inf 99.9%
if -3.89999999999999999e31 < x < 1.0399999999999999e-209Initial program 99.9%
Taylor expanded in y around inf 87.5%
Taylor expanded in y around 0 87.5%
if 1.0399999999999999e-209 < x < 1.90000000000000006e-9Initial program 99.9%
associate-+l+99.9%
*-un-lft-identity99.9%
+-commutative99.9%
*-un-lft-identity99.9%
distribute-rgt-out99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 87.4%
Final simplification93.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* (+ y z) 2.0)))))
(if (<= x -3.9e+31)
t_1
(if (<= x 3.25e-208)
(+ (* y (+ 5.0 (* x 2.0))) (* x t))
(if (<= x 2.1e-8) (+ (* y 5.0) (* 2.0 (* x z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -3.9e+31) {
tmp = t_1;
} else if (x <= 3.25e-208) {
tmp = (y * (5.0 + (x * 2.0))) + (x * t);
} else if (x <= 2.1e-8) {
tmp = (y * 5.0) + (2.0 * (x * z));
} 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 * (t + ((y + z) * 2.0d0))
if (x <= (-3.9d+31)) then
tmp = t_1
else if (x <= 3.25d-208) then
tmp = (y * (5.0d0 + (x * 2.0d0))) + (x * t)
else if (x <= 2.1d-8) then
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
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 + z) * 2.0));
double tmp;
if (x <= -3.9e+31) {
tmp = t_1;
} else if (x <= 3.25e-208) {
tmp = (y * (5.0 + (x * 2.0))) + (x * t);
} else if (x <= 2.1e-8) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -3.9e+31: tmp = t_1 elif x <= 3.25e-208: tmp = (y * (5.0 + (x * 2.0))) + (x * t) elif x <= 2.1e-8: tmp = (y * 5.0) + (2.0 * (x * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -3.9e+31) tmp = t_1; elseif (x <= 3.25e-208) tmp = Float64(Float64(y * Float64(5.0 + Float64(x * 2.0))) + Float64(x * t)); elseif (x <= 2.1e-8) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + ((y + z) * 2.0)); tmp = 0.0; if (x <= -3.9e+31) tmp = t_1; elseif (x <= 3.25e-208) tmp = (y * (5.0 + (x * 2.0))) + (x * t); elseif (x <= 2.1e-8) tmp = (y * 5.0) + (2.0 * (x * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.9e+31], t$95$1, If[LessEqual[x, 3.25e-208], N[(N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e-8], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.25 \cdot 10^{-208}:\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right) + x \cdot t\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-8}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.89999999999999999e31 or 2.09999999999999994e-8 < x Initial program 100.0%
+-commutative100.0%
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%
Taylor expanded in x around inf 99.9%
if -3.89999999999999999e31 < x < 3.2499999999999999e-208Initial program 99.9%
Taylor expanded in y around inf 87.5%
Taylor expanded in y around 0 87.5%
if 3.2499999999999999e-208 < x < 2.09999999999999994e-8Initial program 99.9%
Taylor expanded in z around inf 86.5%
Final simplification93.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* (+ y z) 2.0)))))
(if (<= x -0.0145)
t_1
(if (<= x 1.8e-209)
(+ (* y 5.0) (* x t))
(if (<= x 2.7e-9) (+ (* y 5.0) (* 2.0 (* x z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t + ((y + z) * 2.0));
double tmp;
if (x <= -0.0145) {
tmp = t_1;
} else if (x <= 1.8e-209) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 2.7e-9) {
tmp = (y * 5.0) + (2.0 * (x * z));
} 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 * (t + ((y + z) * 2.0d0))
if (x <= (-0.0145d0)) then
tmp = t_1
else if (x <= 1.8d-209) then
tmp = (y * 5.0d0) + (x * t)
else if (x <= 2.7d-9) then
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
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 + z) * 2.0));
double tmp;
if (x <= -0.0145) {
tmp = t_1;
} else if (x <= 1.8e-209) {
tmp = (y * 5.0) + (x * t);
} else if (x <= 2.7e-9) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t + ((y + z) * 2.0)) tmp = 0 if x <= -0.0145: tmp = t_1 elif x <= 1.8e-209: tmp = (y * 5.0) + (x * t) elif x <= 2.7e-9: tmp = (y * 5.0) + (2.0 * (x * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t + Float64(Float64(y + z) * 2.0))) tmp = 0.0 if (x <= -0.0145) tmp = t_1; elseif (x <= 1.8e-209) tmp = Float64(Float64(y * 5.0) + Float64(x * t)); elseif (x <= 2.7e-9) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t + ((y + z) * 2.0)); tmp = 0.0; if (x <= -0.0145) tmp = t_1; elseif (x <= 1.8e-209) tmp = (y * 5.0) + (x * t); elseif (x <= 2.7e-9) tmp = (y * 5.0) + (2.0 * (x * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.0145], t$95$1, If[LessEqual[x, 1.8e-209], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.7e-9], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{if}\;x \leq -0.0145:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-209}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-9}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -0.0145000000000000007 or 2.7000000000000002e-9 < x Initial program 100.0%
+-commutative100.0%
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%
Taylor expanded in x around inf 98.8%
if -0.0145000000000000007 < x < 1.80000000000000008e-209Initial program 99.9%
Taylor expanded in t around inf 87.2%
if 1.80000000000000008e-209 < x < 2.7000000000000002e-9Initial program 99.9%
Taylor expanded in z around inf 86.5%
Final simplification93.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ t (* z 2.0)))))
(if (<= x -3.25e-109)
t_1
(if (<= x 8.6e-69)
(* y 5.0)
(if (<= x 6e+45) 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 <= -3.25e-109) {
tmp = t_1;
} else if (x <= 8.6e-69) {
tmp = y * 5.0;
} else if (x <= 6e+45) {
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 <= (-3.25d-109)) then
tmp = t_1
else if (x <= 8.6d-69) then
tmp = y * 5.0d0
else if (x <= 6d+45) 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 <= -3.25e-109) {
tmp = t_1;
} else if (x <= 8.6e-69) {
tmp = y * 5.0;
} else if (x <= 6e+45) {
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 <= -3.25e-109: tmp = t_1 elif x <= 8.6e-69: tmp = y * 5.0 elif x <= 6e+45: 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 <= -3.25e-109) tmp = t_1; elseif (x <= 8.6e-69) tmp = Float64(y * 5.0); elseif (x <= 6e+45) 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 <= -3.25e-109) tmp = t_1; elseif (x <= 8.6e-69) tmp = y * 5.0; elseif (x <= 6e+45) 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, -3.25e-109], t$95$1, If[LessEqual[x, 8.6e-69], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 6e+45], 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 -3.25 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{-69}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if x < -3.2499999999999998e-109 or 8.59999999999999999e-69 < x < 6.00000000000000021e45Initial 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%
Taylor expanded in y around 0 69.8%
+-commutative69.8%
Simplified69.8%
if -3.2499999999999998e-109 < x < 8.59999999999999999e-69Initial 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%
Taylor expanded in x around 0 69.3%
*-commutative69.3%
Simplified69.3%
if 6.00000000000000021e45 < x Initial program 100.0%
+-commutative100.0%
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%
Taylor expanded in x around inf 100.0%
Taylor expanded in z around 0 75.2%
+-commutative75.2%
Simplified75.2%
Final simplification70.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.5) (not (<= x 4.4e-7))) (* x (+ t (* (+ y 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 <= -2.5) || !(x <= 4.4e-7)) {
tmp = x * (t + ((y + 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 <= (-2.5d0)) .or. (.not. (x <= 4.4d-7))) then
tmp = x * (t + ((y + 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 <= -2.5) || !(x <= 4.4e-7)) {
tmp = x * (t + ((y + 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 <= -2.5) or not (x <= 4.4e-7): tmp = x * (t + ((y + 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 <= -2.5) || !(x <= 4.4e-7)) tmp = Float64(x * Float64(t + Float64(Float64(y + 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 <= -2.5) || ~((x <= 4.4e-7))) tmp = x * (t + ((y + 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, -2.5], N[Not[LessEqual[x, 4.4e-7]], $MachinePrecision]], N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $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 -2.5 \lor \neg \left(x \leq 4.4 \cdot 10^{-7}\right):\\
\;\;\;\;x \cdot \left(t + \left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if x < -2.5 or 4.4000000000000002e-7 < x Initial program 100.0%
+-commutative100.0%
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%
Taylor expanded in x around inf 98.8%
if -2.5 < x < 4.4000000000000002e-7Initial program 99.9%
Taylor expanded in y around 0 99.4%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.3e+78) (not (<= z 7e-11))) (+ (* y 5.0) (* x (* (+ y z) 2.0))) (+ (* y 5.0) (* x (+ t (* y 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.3e+78) || !(z <= 7e-11)) {
tmp = (y * 5.0) + (x * ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (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) :: tmp
if ((z <= (-2.3d+78)) .or. (.not. (z <= 7d-11))) then
tmp = (y * 5.0d0) + (x * ((y + z) * 2.0d0))
else
tmp = (y * 5.0d0) + (x * (t + (y * 2.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.3e+78) || !(z <= 7e-11)) {
tmp = (y * 5.0) + (x * ((y + z) * 2.0));
} else {
tmp = (y * 5.0) + (x * (t + (y * 2.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.3e+78) or not (z <= 7e-11): tmp = (y * 5.0) + (x * ((y + z) * 2.0)) else: tmp = (y * 5.0) + (x * (t + (y * 2.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.3e+78) || !(z <= 7e-11)) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(Float64(y + z) * 2.0))); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y * 2.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.3e+78) || ~((z <= 7e-11))) tmp = (y * 5.0) + (x * ((y + z) * 2.0)); else tmp = (y * 5.0) + (x * (t + (y * 2.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.3e+78], N[Not[LessEqual[z, 7e-11]], $MachinePrecision]], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+78} \lor \neg \left(z \leq 7 \cdot 10^{-11}\right):\\
\;\;\;\;y \cdot 5 + x \cdot \left(\left(y + z\right) \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if z < -2.3000000000000002e78 or 7.00000000000000038e-11 < z Initial program 100.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%
Taylor expanded in t around 0 90.7%
if -2.3000000000000002e78 < z < 7.00000000000000038e-11Initial program 99.9%
Taylor expanded in y around inf 94.5%
Final simplification92.8%
(FPCore (x y z t)
:precision binary64
(if (<= x -2.1e-67)
(* x t)
(if (<= x 3.8e-45)
(* y 5.0)
(if (<= x 8e+46) (* x (* z 2.0)) (* y (* x 2.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.1e-67) {
tmp = x * t;
} else if (x <= 3.8e-45) {
tmp = y * 5.0;
} else if (x <= 8e+46) {
tmp = x * (z * 2.0);
} else {
tmp = y * (x * 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 <= (-2.1d-67)) then
tmp = x * t
else if (x <= 3.8d-45) then
tmp = y * 5.0d0
else if (x <= 8d+46) then
tmp = x * (z * 2.0d0)
else
tmp = y * (x * 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.1e-67) {
tmp = x * t;
} else if (x <= 3.8e-45) {
tmp = y * 5.0;
} else if (x <= 8e+46) {
tmp = x * (z * 2.0);
} else {
tmp = y * (x * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.1e-67: tmp = x * t elif x <= 3.8e-45: tmp = y * 5.0 elif x <= 8e+46: tmp = x * (z * 2.0) else: tmp = y * (x * 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.1e-67) tmp = Float64(x * t); elseif (x <= 3.8e-45) tmp = Float64(y * 5.0); elseif (x <= 8e+46) tmp = Float64(x * Float64(z * 2.0)); else tmp = Float64(y * Float64(x * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.1e-67) tmp = x * t; elseif (x <= 3.8e-45) tmp = y * 5.0; elseif (x <= 8e+46) tmp = x * (z * 2.0); else tmp = y * (x * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.1e-67], N[(x * t), $MachinePrecision], If[LessEqual[x, 3.8e-45], N[(y * 5.0), $MachinePrecision], If[LessEqual[x, 8e+46], N[(x * N[(z * 2.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-67}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-45}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+46}:\\
\;\;\;\;x \cdot \left(z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\end{array}
\end{array}
if x < -2.1000000000000002e-67Initial 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%
Taylor expanded in t around inf 42.8%
*-commutative42.8%
Simplified42.8%
if -2.1000000000000002e-67 < x < 3.79999999999999997e-45Initial 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%
Taylor expanded in x around 0 66.2%
*-commutative66.2%
Simplified66.2%
if 3.79999999999999997e-45 < x < 7.9999999999999999e46Initial 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%
Taylor expanded in z around inf 48.8%
*-commutative48.8%
associate-*r*48.8%
Simplified48.8%
if 7.9999999999999999e46 < x Initial program 100.0%
Taylor expanded in y around inf 45.1%
Taylor expanded in x around inf 45.1%
Final simplification52.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -0.0145) (not (<= x 3.8e-45))) (* 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 <= -0.0145) || !(x <= 3.8e-45)) {
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 <= (-0.0145d0)) .or. (.not. (x <= 3.8d-45))) 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 <= -0.0145) || !(x <= 3.8e-45)) {
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 <= -0.0145) or not (x <= 3.8e-45): 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 <= -0.0145) || !(x <= 3.8e-45)) 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 <= -0.0145) || ~((x <= 3.8e-45))) 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, -0.0145], N[Not[LessEqual[x, 3.8e-45]], $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 -0.0145 \lor \neg \left(x \leq 3.8 \cdot 10^{-45}\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 < -0.0145000000000000007 or 3.79999999999999997e-45 < x Initial program 100.0%
+-commutative100.0%
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%
Taylor expanded in x around inf 97.6%
if -0.0145000000000000007 < x < 3.79999999999999997e-45Initial program 99.9%
Taylor expanded in t around inf 83.5%
Final simplification91.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.15e+65) (not (<= y 3.1e+57))) (* y (+ 5.0 (* x 2.0))) (* x (+ t (* z 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.15e+65) || !(y <= 3.1e+57)) {
tmp = y * (5.0 + (x * 2.0));
} 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) :: tmp
if ((y <= (-1.15d+65)) .or. (.not. (y <= 3.1d+57))) then
tmp = y * (5.0d0 + (x * 2.0d0))
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 tmp;
if ((y <= -1.15e+65) || !(y <= 3.1e+57)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * (t + (z * 2.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.15e+65) or not (y <= 3.1e+57): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * (t + (z * 2.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.15e+65) || !(y <= 3.1e+57)) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * Float64(t + Float64(z * 2.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.15e+65) || ~((y <= 3.1e+57))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * (t + (z * 2.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.15e+65], N[Not[LessEqual[y, 3.1e+57]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+65} \lor \neg \left(y \leq 3.1 \cdot 10^{+57}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t + z \cdot 2\right)\\
\end{array}
\end{array}
if y < -1.15e65 or 3.10000000000000013e57 < y Initial program 99.9%
Taylor expanded in y around inf 82.7%
if -1.15e65 < y < 3.10000000000000013e57Initial 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%
Taylor expanded in y around 0 80.0%
+-commutative80.0%
Simplified80.0%
Final simplification81.2%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.1e-67) (not (<= x 1100.0))) (* x (+ t (* y 2.0))) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.1e-67) || !(x <= 1100.0)) {
tmp = x * (t + (y * 2.0));
} else {
tmp = 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 <= (-2.1d-67)) .or. (.not. (x <= 1100.0d0))) then
tmp = x * (t + (y * 2.0d0))
else
tmp = 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 <= -2.1e-67) || !(x <= 1100.0)) {
tmp = x * (t + (y * 2.0));
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.1e-67) or not (x <= 1100.0): tmp = x * (t + (y * 2.0)) else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.1e-67) || !(x <= 1100.0)) tmp = Float64(x * Float64(t + Float64(y * 2.0))); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.1e-67) || ~((x <= 1100.0))) tmp = x * (t + (y * 2.0)); else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.1e-67], N[Not[LessEqual[x, 1100.0]], $MachinePrecision]], N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-67} \lor \neg \left(x \leq 1100\right):\\
\;\;\;\;x \cdot \left(t + y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -2.1000000000000002e-67 or 1100 < x Initial program 100.0%
+-commutative100.0%
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%
Taylor expanded in x around inf 96.3%
Taylor expanded in z around 0 70.4%
+-commutative70.4%
Simplified70.4%
if -2.1000000000000002e-67 < x < 1100Initial 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%
Taylor expanded in x around 0 63.5%
*-commutative63.5%
Simplified63.5%
Final simplification67.5%
(FPCore (x y z t) :precision binary64 (if (<= x -2.1e-67) (* x t) (if (<= x 4.4e-7) (* y 5.0) (* y (* x 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.1e-67) {
tmp = x * t;
} else if (x <= 4.4e-7) {
tmp = y * 5.0;
} else {
tmp = y * (x * 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 <= (-2.1d-67)) then
tmp = x * t
else if (x <= 4.4d-7) then
tmp = y * 5.0d0
else
tmp = y * (x * 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.1e-67) {
tmp = x * t;
} else if (x <= 4.4e-7) {
tmp = y * 5.0;
} else {
tmp = y * (x * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.1e-67: tmp = x * t elif x <= 4.4e-7: tmp = y * 5.0 else: tmp = y * (x * 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.1e-67) tmp = Float64(x * t); elseif (x <= 4.4e-7) tmp = Float64(y * 5.0); else tmp = Float64(y * Float64(x * 2.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.1e-67) tmp = x * t; elseif (x <= 4.4e-7) tmp = y * 5.0; else tmp = y * (x * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.1e-67], N[(x * t), $MachinePrecision], If[LessEqual[x, 4.4e-7], N[(y * 5.0), $MachinePrecision], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-67}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-7}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\end{array}
\end{array}
if x < -2.1000000000000002e-67Initial 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%
Taylor expanded in t around inf 42.8%
*-commutative42.8%
Simplified42.8%
if -2.1000000000000002e-67 < x < 4.4000000000000002e-7Initial 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%
Taylor expanded in x around 0 64.7%
*-commutative64.7%
Simplified64.7%
if 4.4000000000000002e-7 < x Initial program 100.0%
Taylor expanded in y around inf 39.8%
Taylor expanded in x around inf 39.6%
Final simplification50.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.05e-67) (not (<= x 1100.0))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.05e-67) || !(x <= 1100.0)) {
tmp = x * t;
} else {
tmp = 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 <= (-2.05d-67)) .or. (.not. (x <= 1100.0d0))) then
tmp = x * t
else
tmp = 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 <= -2.05e-67) || !(x <= 1100.0)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.05e-67) or not (x <= 1100.0): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.05e-67) || !(x <= 1100.0)) tmp = Float64(x * t); else tmp = Float64(y * 5.0); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.05e-67) || ~((x <= 1100.0))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.05e-67], N[Not[LessEqual[x, 1100.0]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{-67} \lor \neg \left(x \leq 1100\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -2.0499999999999999e-67 or 1100 < x Initial program 100.0%
+-commutative100.0%
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%
Taylor expanded in t around inf 39.5%
*-commutative39.5%
Simplified39.5%
if -2.0499999999999999e-67 < x < 1100Initial 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%
Taylor expanded in x around 0 63.5%
*-commutative63.5%
Simplified63.5%
Final simplification49.5%
(FPCore (x y z t) :precision binary64 (+ (* y 5.0) (* x (+ t (* (+ y z) 2.0)))))
double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + ((y + z) * 2.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) + (x * (t + ((y + z) * 2.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (y * 5.0) + (x * (t + ((y + z) * 2.0)));
}
def code(x, y, z, t): return (y * 5.0) + (x * (t + ((y + z) * 2.0)))
function code(x, y, z, t) return Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(Float64(y + z) * 2.0)))) end
function tmp = code(x, y, z, t) tmp = (y * 5.0) + (x * (t + ((y + z) * 2.0))); end
code[x_, y_, z_, t_] := N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5 + x \cdot \left(t + \left(y + z\right) \cdot 2\right)
\end{array}
Initial program 99.9%
associate-+l+99.9%
*-un-lft-identity99.9%
+-commutative99.9%
*-un-lft-identity99.9%
distribute-rgt-out99.9%
metadata-eval99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (* x t))
double code(double x, double y, double z, double t) {
return x * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * t
end function
public static double code(double x, double y, double z, double t) {
return x * t;
}
def code(x, y, z, t): return x * t
function code(x, y, z, t) return Float64(x * t) end
function tmp = code(x, y, z, t) tmp = x * t; end
code[x_, y_, z_, t_] := N[(x * t), $MachinePrecision]
\begin{array}{l}
\\
x \cdot t
\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%
Taylor expanded in t around inf 31.4%
*-commutative31.4%
Simplified31.4%
herbie shell --seed 2024144
(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)))