
(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 10 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 (+ (* x (+ t (* 2.0 (+ y z)))) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * (t + (2.0 * (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 + (2.0d0 * (y + z)))) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * (t + (2.0 * (y + z)))) + (y * 5.0);
}
def code(x, y, z, t): return (x * (t + (2.0 * (y + z)))) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(t + Float64(2.0 * Float64(y + z)))) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * (t + (2.0 * (y + z)))) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(t + N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(t + 2 \cdot \left(y + z\right)\right) + y \cdot 5
\end{array}
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%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.85e+76) (not (<= z 9.2e-39))) (+ (* y 5.0) (* x (+ t (* 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 <= -1.85e+76) || !(z <= 9.2e-39)) {
tmp = (y * 5.0) + (x * (t + (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 <= (-1.85d+76)) .or. (.not. (z <= 9.2d-39))) then
tmp = (y * 5.0d0) + (x * (t + (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 <= -1.85e+76) || !(z <= 9.2e-39)) {
tmp = (y * 5.0) + (x * (t + (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 <= -1.85e+76) or not (z <= 9.2e-39): tmp = (y * 5.0) + (x * (t + (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 <= -1.85e+76) || !(z <= 9.2e-39)) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(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 <= -1.85e+76) || ~((z <= 9.2e-39))) tmp = (y * 5.0) + (x * (t + (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, -1.85e+76], N[Not[LessEqual[z, 9.2e-39]], $MachinePrecision]], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(z * 2.0), $MachinePrecision]), $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 -1.85 \cdot 10^{+76} \lor \neg \left(z \leq 9.2 \cdot 10^{-39}\right):\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + z \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + y \cdot 2\right)\\
\end{array}
\end{array}
if z < -1.85e76 or 9.20000000000000033e-39 < z Initial program 99.9%
Taylor expanded in y around 0 98.4%
if -1.85e76 < z < 9.20000000000000033e-39Initial program 100.0%
Taylor expanded in y around inf 96.3%
Final simplification97.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.7e+60) (not (<= t 5.5e-100))) (+ (* y 5.0) (* x (+ t (* y 2.0)))) (+ (* y 5.0) (* x (* 2.0 (+ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.7e+60) || !(t <= 5.5e-100)) {
tmp = (y * 5.0) + (x * (t + (y * 2.0)));
} else {
tmp = (y * 5.0) + (x * (2.0 * (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 ((t <= (-2.7d+60)) .or. (.not. (t <= 5.5d-100))) then
tmp = (y * 5.0d0) + (x * (t + (y * 2.0d0)))
else
tmp = (y * 5.0d0) + (x * (2.0d0 * (y + z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.7e+60) || !(t <= 5.5e-100)) {
tmp = (y * 5.0) + (x * (t + (y * 2.0)));
} else {
tmp = (y * 5.0) + (x * (2.0 * (y + z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.7e+60) or not (t <= 5.5e-100): tmp = (y * 5.0) + (x * (t + (y * 2.0))) else: tmp = (y * 5.0) + (x * (2.0 * (y + z))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.7e+60) || !(t <= 5.5e-100)) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(t + Float64(y * 2.0)))); else tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(2.0 * Float64(y + z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.7e+60) || ~((t <= 5.5e-100))) tmp = (y * 5.0) + (x * (t + (y * 2.0))); else tmp = (y * 5.0) + (x * (2.0 * (y + z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.7e+60], N[Not[LessEqual[t, 5.5e-100]], $MachinePrecision]], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(t + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+60} \lor \neg \left(t \leq 5.5 \cdot 10^{-100}\right):\\
\;\;\;\;y \cdot 5 + x \cdot \left(t + y \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\end{array}
\end{array}
if t < -2.6999999999999999e60 or 5.50000000000000011e-100 < t Initial program 100.0%
Taylor expanded in y around inf 89.4%
if -2.6999999999999999e60 < t < 5.50000000000000011e-100Initial 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 95.5%
*-commutative95.5%
associate-*r*95.5%
*-commutative95.5%
+-commutative95.5%
Simplified95.5%
Final simplification92.4%
(FPCore (x y z t)
:precision binary64
(if (<= t -8.8e+61)
(* t (+ x (* 5.0 (/ y t))))
(if (<= t 1.28e+95)
(+ (* y 5.0) (* x (* 2.0 (+ y z))))
(+ (* y 5.0) (* x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -8.8e+61) {
tmp = t * (x + (5.0 * (y / t)));
} else if (t <= 1.28e+95) {
tmp = (y * 5.0) + (x * (2.0 * (y + z)));
} 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 (t <= (-8.8d+61)) then
tmp = t * (x + (5.0d0 * (y / t)))
else if (t <= 1.28d+95) then
tmp = (y * 5.0d0) + (x * (2.0d0 * (y + z)))
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 (t <= -8.8e+61) {
tmp = t * (x + (5.0 * (y / t)));
} else if (t <= 1.28e+95) {
tmp = (y * 5.0) + (x * (2.0 * (y + z)));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -8.8e+61: tmp = t * (x + (5.0 * (y / t))) elif t <= 1.28e+95: tmp = (y * 5.0) + (x * (2.0 * (y + z))) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -8.8e+61) tmp = Float64(t * Float64(x + Float64(5.0 * Float64(y / t)))); elseif (t <= 1.28e+95) tmp = Float64(Float64(y * 5.0) + Float64(x * Float64(2.0 * Float64(y + z)))); 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 (t <= -8.8e+61) tmp = t * (x + (5.0 * (y / t))); elseif (t <= 1.28e+95) tmp = (y * 5.0) + (x * (2.0 * (y + z))); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -8.8e+61], N[(t * N[(x + N[(5.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.28e+95], N[(N[(y * 5.0), $MachinePrecision] + N[(x * N[(2.0 * N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.8 \cdot 10^{+61}:\\
\;\;\;\;t \cdot \left(x + 5 \cdot \frac{y}{t}\right)\\
\mathbf{elif}\;t \leq 1.28 \cdot 10^{+95}:\\
\;\;\;\;y \cdot 5 + x \cdot \left(2 \cdot \left(y + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if t < -8.8000000000000001e61Initial 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 inf 81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in t around inf 81.8%
if -8.8000000000000001e61 < t < 1.28000000000000006e95Initial 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.4%
*-commutative90.4%
associate-*r*90.4%
*-commutative90.4%
+-commutative90.4%
Simplified90.4%
if 1.28000000000000006e95 < t Initial program 100.0%
Taylor expanded in t around inf 88.0%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (if (<= t -6.2e+59) (* t (+ x (* 5.0 (/ y t)))) (if (<= t 6.6e-100) (+ (* y 5.0) (* 2.0 (* x z))) (+ (* y 5.0) (* x t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -6.2e+59) {
tmp = t * (x + (5.0 * (y / t)));
} else if (t <= 6.6e-100) {
tmp = (y * 5.0) + (2.0 * (x * z));
} 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 (t <= (-6.2d+59)) then
tmp = t * (x + (5.0d0 * (y / t)))
else if (t <= 6.6d-100) then
tmp = (y * 5.0d0) + (2.0d0 * (x * z))
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 (t <= -6.2e+59) {
tmp = t * (x + (5.0 * (y / t)));
} else if (t <= 6.6e-100) {
tmp = (y * 5.0) + (2.0 * (x * z));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -6.2e+59: tmp = t * (x + (5.0 * (y / t))) elif t <= 6.6e-100: tmp = (y * 5.0) + (2.0 * (x * z)) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -6.2e+59) tmp = Float64(t * Float64(x + Float64(5.0 * Float64(y / t)))); elseif (t <= 6.6e-100) tmp = Float64(Float64(y * 5.0) + Float64(2.0 * Float64(x * z))); 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 (t <= -6.2e+59) tmp = t * (x + (5.0 * (y / t))); elseif (t <= 6.6e-100) tmp = (y * 5.0) + (2.0 * (x * z)); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -6.2e+59], N[(t * N[(x + N[(5.0 * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.6e-100], N[(N[(y * 5.0), $MachinePrecision] + N[(2.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{+59}:\\
\;\;\;\;t \cdot \left(x + 5 \cdot \frac{y}{t}\right)\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{-100}:\\
\;\;\;\;y \cdot 5 + 2 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if t < -6.20000000000000029e59Initial 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 inf 81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in t around inf 81.8%
if -6.20000000000000029e59 < t < 6.59999999999999993e-100Initial program 100.0%
Taylor expanded in z around inf 77.2%
if 6.59999999999999993e-100 < t Initial program 100.0%
Taylor expanded in t around inf 79.2%
Final simplification78.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9.8e-11) (not (<= y 5.1e+97))) (* y (+ 5.0 (* x 2.0))) (+ (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.8e-11) || !(y <= 5.1e+97)) {
tmp = y * (5.0 + (x * 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 ((y <= (-9.8d-11)) .or. (.not. (y <= 5.1d+97))) then
tmp = y * (5.0d0 + (x * 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 ((y <= -9.8e-11) || !(y <= 5.1e+97)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = (y * 5.0) + (x * t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9.8e-11) or not (y <= 5.1e+97): tmp = y * (5.0 + (x * 2.0)) else: tmp = (y * 5.0) + (x * t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9.8e-11) || !(y <= 5.1e+97)) tmp = Float64(y * Float64(5.0 + Float64(x * 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 ((y <= -9.8e-11) || ~((y <= 5.1e+97))) tmp = y * (5.0 + (x * 2.0)); else tmp = (y * 5.0) + (x * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9.8e-11], N[Not[LessEqual[y, 5.1e+97]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 5.0), $MachinePrecision] + N[(x * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.8 \cdot 10^{-11} \lor \neg \left(y \leq 5.1 \cdot 10^{+97}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5 + x \cdot t\\
\end{array}
\end{array}
if y < -9.7999999999999998e-11 or 5.10000000000000034e97 < y Initial program 99.9%
Taylor expanded in y around inf 87.6%
if -9.7999999999999998e-11 < y < 5.10000000000000034e97Initial program 100.0%
Taylor expanded in t around inf 58.4%
Final simplification70.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.8e-38) (not (<= y 1e-25))) (* y (+ 5.0 (* x 2.0))) (* x t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.8e-38) || !(y <= 1e-25)) {
tmp = y * (5.0 + (x * 2.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 <= (-3.8d-38)) .or. (.not. (y <= 1d-25))) then
tmp = y * (5.0d0 + (x * 2.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 <= -3.8e-38) || !(y <= 1e-25)) {
tmp = y * (5.0 + (x * 2.0));
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.8e-38) or not (y <= 1e-25): tmp = y * (5.0 + (x * 2.0)) else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.8e-38) || !(y <= 1e-25)) tmp = Float64(y * Float64(5.0 + Float64(x * 2.0))); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.8e-38) || ~((y <= 1e-25))) tmp = y * (5.0 + (x * 2.0)); else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.8e-38], N[Not[LessEqual[y, 1e-25]], $MachinePrecision]], N[(y * N[(5.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{-38} \lor \neg \left(y \leq 10^{-25}\right):\\
\;\;\;\;y \cdot \left(5 + x \cdot 2\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if y < -3.8e-38 or 1.00000000000000004e-25 < y Initial program 99.9%
Taylor expanded in y around inf 77.2%
if -3.8e-38 < y < 1.00000000000000004e-25Initial 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 inf 57.4%
*-commutative57.4%
Simplified57.4%
Taylor expanded in t around inf 57.4%
Taylor expanded in t around inf 46.0%
Final simplification62.6%
(FPCore (x y z t) :precision binary64 (if (<= x -2.75e-64) (* x t) (if (<= x 5.2e-16) (* y 5.0) (* y (* x 2.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.75e-64) {
tmp = x * t;
} else if (x <= 5.2e-16) {
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.75d-64)) then
tmp = x * t
else if (x <= 5.2d-16) 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.75e-64) {
tmp = x * t;
} else if (x <= 5.2e-16) {
tmp = y * 5.0;
} else {
tmp = y * (x * 2.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.75e-64: tmp = x * t elif x <= 5.2e-16: tmp = y * 5.0 else: tmp = y * (x * 2.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.75e-64) tmp = Float64(x * t); elseif (x <= 5.2e-16) 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.75e-64) tmp = x * t; elseif (x <= 5.2e-16) tmp = y * 5.0; else tmp = y * (x * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.75e-64], N[(x * t), $MachinePrecision], If[LessEqual[x, 5.2e-16], N[(y * 5.0), $MachinePrecision], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.75 \cdot 10^{-64}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-16}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\
\end{array}
\end{array}
if x < -2.7499999999999999e-64Initial 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 inf 52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in t around inf 52.6%
Taylor expanded in t around inf 49.1%
if -2.7499999999999999e-64 < x < 5.1999999999999997e-16Initial program 99.9%
Taylor expanded in y around inf 58.9%
Taylor expanded in x around 0 58.9%
*-commutative58.9%
Simplified58.9%
if 5.1999999999999997e-16 < x Initial program 100.0%
Taylor expanded in y around inf 38.4%
Taylor expanded in x around inf 38.3%
Final simplification50.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.1e-69) (not (<= x 4.4e-30))) (* x t) (* y 5.0)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.1e-69) || !(x <= 4.4e-30)) {
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 <= (-4.1d-69)) .or. (.not. (x <= 4.4d-30))) 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 <= -4.1e-69) || !(x <= 4.4e-30)) {
tmp = x * t;
} else {
tmp = y * 5.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.1e-69) or not (x <= 4.4e-30): tmp = x * t else: tmp = y * 5.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.1e-69) || !(x <= 4.4e-30)) 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 <= -4.1e-69) || ~((x <= 4.4e-30))) tmp = x * t; else tmp = y * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.1e-69], N[Not[LessEqual[x, 4.4e-30]], $MachinePrecision]], N[(x * t), $MachinePrecision], N[(y * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{-69} \lor \neg \left(x \leq 4.4 \cdot 10^{-30}\right):\\
\;\;\;\;x \cdot t\\
\mathbf{else}:\\
\;\;\;\;y \cdot 5\\
\end{array}
\end{array}
if x < -4.0999999999999999e-69 or 4.39999999999999967e-30 < x 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 inf 45.8%
*-commutative45.8%
Simplified45.8%
Taylor expanded in t around inf 50.5%
Taylor expanded in t around inf 43.3%
if -4.0999999999999999e-69 < x < 4.39999999999999967e-30Initial program 99.9%
Taylor expanded in y around inf 59.3%
Taylor expanded in x around 0 59.3%
*-commutative59.3%
Simplified59.3%
Final simplification50.6%
(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 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 inf 58.3%
*-commutative58.3%
Simplified58.3%
Taylor expanded in t around inf 55.4%
Taylor expanded in t around inf 31.0%
Final simplification31.0%
herbie shell --seed 2024139
(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)))