
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (fma (+ a -0.5) b (+ x (+ y (- z (* z (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((a + -0.5), b, (x + (y + (z - (z * log(t))))));
}
function code(x, y, z, t, a, b) return fma(Float64(a + -0.5), b, Float64(x + Float64(y + Float64(z - Float64(z * log(t)))))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + N[(y + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, b, x + \left(y + \left(z - z \cdot \log t\right)\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -12.5) (not (<= z 5800000000000.0))) (+ (* b (- a 0.5)) (- (+ y z) (* z (log t)))) (+ x (+ y (+ (* -0.5 b) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -12.5) || !(z <= 5800000000000.0)) {
tmp = (b * (a - 0.5)) + ((y + z) - (z * log(t)));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-12.5d0)) .or. (.not. (z <= 5800000000000.0d0))) then
tmp = (b * (a - 0.5d0)) + ((y + z) - (z * log(t)))
else
tmp = x + (y + (((-0.5d0) * b) + (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -12.5) || !(z <= 5800000000000.0)) {
tmp = (b * (a - 0.5)) + ((y + z) - (z * Math.log(t)));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -12.5) or not (z <= 5800000000000.0): tmp = (b * (a - 0.5)) + ((y + z) - (z * math.log(t))) else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -12.5) || !(z <= 5800000000000.0)) tmp = Float64(Float64(b * Float64(a - 0.5)) + Float64(Float64(y + z) - Float64(z * log(t)))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -12.5) || ~((z <= 5800000000000.0))) tmp = (b * (a - 0.5)) + ((y + z) - (z * log(t))); else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -12.5], N[Not[LessEqual[z, 5800000000000.0]], $MachinePrecision]], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(y + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -12.5 \lor \neg \left(z \leq 5800000000000\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right) + \left(\left(y + z\right) - z \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -12.5 or 5.8e12 < z Initial program 99.8%
Taylor expanded in x around 0 87.3%
+-commutative87.3%
Simplified87.3%
if -12.5 < z < 5.8e12Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 97.1%
Final simplification92.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.25e+146) (not (<= z 6.4e+150))) (+ (- z (* z (log t))) (+ x y)) (+ x (+ y (+ (* -0.5 b) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.25e+146) || !(z <= 6.4e+150)) {
tmp = (z - (z * log(t))) + (x + y);
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.25d+146)) .or. (.not. (z <= 6.4d+150))) then
tmp = (z - (z * log(t))) + (x + y)
else
tmp = x + (y + (((-0.5d0) * b) + (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.25e+146) || !(z <= 6.4e+150)) {
tmp = (z - (z * Math.log(t))) + (x + y);
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.25e+146) or not (z <= 6.4e+150): tmp = (z - (z * math.log(t))) + (x + y) else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.25e+146) || !(z <= 6.4e+150)) tmp = Float64(Float64(z - Float64(z * log(t))) + Float64(x + y)); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.25e+146) || ~((z <= 6.4e+150))) tmp = (z - (z * log(t))) + (x + y); else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.25e+146], N[Not[LessEqual[z, 6.4e+150]], $MachinePrecision]], N[(N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+146} \lor \neg \left(z \leq 6.4 \cdot 10^{+150}\right):\\
\;\;\;\;\left(z - z \cdot \log t\right) + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -1.25e146 or 6.40000000000000031e150 < z Initial program 99.6%
Taylor expanded in a around 0 99.6%
Taylor expanded in b around 0 88.8%
associate-+r+88.8%
associate-+r-88.8%
+-commutative88.8%
Simplified88.8%
if -1.25e146 < z < 6.40000000000000031e150Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 90.5%
Final simplification90.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.2e+145) (not (<= z 2.5e+159))) (+ (+ x y) (* z (- 1.0 (log t)))) (+ x (+ y (+ (* -0.5 b) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.2e+145) || !(z <= 2.5e+159)) {
tmp = (x + y) + (z * (1.0 - log(t)));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-8.2d+145)) .or. (.not. (z <= 2.5d+159))) then
tmp = (x + y) + (z * (1.0d0 - log(t)))
else
tmp = x + (y + (((-0.5d0) * b) + (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.2e+145) || !(z <= 2.5e+159)) {
tmp = (x + y) + (z * (1.0 - Math.log(t)));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.2e+145) or not (z <= 2.5e+159): tmp = (x + y) + (z * (1.0 - math.log(t))) else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.2e+145) || !(z <= 2.5e+159)) tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8.2e+145) || ~((z <= 2.5e+159))) tmp = (x + y) + (z * (1.0 - log(t))); else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.2e+145], N[Not[LessEqual[z, 2.5e+159]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+145} \lor \neg \left(z \leq 2.5 \cdot 10^{+159}\right):\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -8.2000000000000003e145 or 2.50000000000000002e159 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in b around 0 88.7%
if -8.2000000000000003e145 < z < 2.50000000000000002e159Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 90.5%
Final simplification90.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.8e+147) (not (<= z 3.4e+158))) (+ y (- z (* z (log t)))) (+ x (+ y (+ (* -0.5 b) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.8e+147) || !(z <= 3.4e+158)) {
tmp = y + (z - (z * log(t)));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-8.8d+147)) .or. (.not. (z <= 3.4d+158))) then
tmp = y + (z - (z * log(t)))
else
tmp = x + (y + (((-0.5d0) * b) + (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.8e+147) || !(z <= 3.4e+158)) {
tmp = y + (z - (z * Math.log(t)));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.8e+147) or not (z <= 3.4e+158): tmp = y + (z - (z * math.log(t))) else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.8e+147) || !(z <= 3.4e+158)) tmp = Float64(y + Float64(z - Float64(z * log(t)))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8.8e+147) || ~((z <= 3.4e+158))) tmp = y + (z - (z * log(t))); else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.8e+147], N[Not[LessEqual[z, 3.4e+158]], $MachinePrecision]], N[(y + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{+147} \lor \neg \left(z \leq 3.4 \cdot 10^{+158}\right):\\
\;\;\;\;y + \left(z - z \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -8.8000000000000007e147 or 3.3999999999999999e158 < z Initial program 99.7%
Taylor expanded in x around 0 91.5%
Taylor expanded in b around 0 81.5%
associate--l+81.5%
Simplified81.5%
if -8.8000000000000007e147 < z < 3.3999999999999999e158Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 90.4%
Final simplification88.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1e+150) (not (<= z 1.4e+178))) (- z (* z (log t))) (+ x (+ y (+ (* -0.5 b) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1e+150) || !(z <= 1.4e+178)) {
tmp = z - (z * log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1d+150)) .or. (.not. (z <= 1.4d+178))) then
tmp = z - (z * log(t))
else
tmp = x + (y + (((-0.5d0) * b) + (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1e+150) || !(z <= 1.4e+178)) {
tmp = z - (z * Math.log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1e+150) or not (z <= 1.4e+178): tmp = z - (z * math.log(t)) else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1e+150) || !(z <= 1.4e+178)) tmp = Float64(z - Float64(z * log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1e+150) || ~((z <= 1.4e+178))) tmp = z - (z * log(t)); else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1e+150], N[Not[LessEqual[z, 1.4e+178]], $MachinePrecision]], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+150} \lor \neg \left(z \leq 1.4 \cdot 10^{+178}\right):\\
\;\;\;\;z - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -9.99999999999999981e149 or 1.39999999999999997e178 < z Initial program 99.7%
Taylor expanded in x around 0 92.8%
Taylor expanded in z around inf 74.7%
if -9.99999999999999981e149 < z < 1.39999999999999997e178Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 90.0%
Final simplification86.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.15e+150) (not (<= z 3.1e+178))) (* z (- 1.0 (log t))) (+ x (+ y (+ (* -0.5 b) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.15e+150) || !(z <= 3.1e+178)) {
tmp = z * (1.0 - log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.15d+150)) .or. (.not. (z <= 3.1d+178))) then
tmp = z * (1.0d0 - log(t))
else
tmp = x + (y + (((-0.5d0) * b) + (a * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.15e+150) || !(z <= 3.1e+178)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.15e+150) or not (z <= 3.1e+178): tmp = z * (1.0 - math.log(t)) else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.15e+150) || !(z <= 3.1e+178)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.15e+150) || ~((z <= 3.1e+178))) tmp = z * (1.0 - log(t)); else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.15e+150], N[Not[LessEqual[z, 3.1e+178]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+150} \lor \neg \left(z \leq 3.1 \cdot 10^{+178}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -1.15000000000000001e150 or 3.09999999999999991e178 < z Initial program 99.7%
Taylor expanded in a around 0 99.6%
Taylor expanded in z around inf 74.6%
if -1.15000000000000001e150 < z < 3.09999999999999991e178Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 90.0%
Final simplification86.2%
(FPCore (x y z t a b) :precision binary64 (+ (- (+ z (+ x y)) (* z (log t))) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * Math.log(t))) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return ((z + (x + y)) - (z * math.log(t))) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(z + Float64(x + y)) - Float64(z * log(t))) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= (- a 0.5) -5e+212)
(and (not (<= (- a 0.5) 1e+30))
(or (<= (- a 0.5) 4e+128) (not (<= (- a 0.5) 2e+176)))))
(* a b)
(+ x (+ y (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a - 0.5) <= -5e+212) || (!((a - 0.5) <= 1e+30) && (((a - 0.5) <= 4e+128) || !((a - 0.5) <= 2e+176)))) {
tmp = a * b;
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((a - 0.5d0) <= (-5d+212)) .or. (.not. ((a - 0.5d0) <= 1d+30)) .and. ((a - 0.5d0) <= 4d+128) .or. (.not. ((a - 0.5d0) <= 2d+176))) then
tmp = a * b
else
tmp = x + (y + ((-0.5d0) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a - 0.5) <= -5e+212) || (!((a - 0.5) <= 1e+30) && (((a - 0.5) <= 4e+128) || !((a - 0.5) <= 2e+176)))) {
tmp = a * b;
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a - 0.5) <= -5e+212) or (not ((a - 0.5) <= 1e+30) and (((a - 0.5) <= 4e+128) or not ((a - 0.5) <= 2e+176))): tmp = a * b else: tmp = x + (y + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a - 0.5) <= -5e+212) || (!(Float64(a - 0.5) <= 1e+30) && ((Float64(a - 0.5) <= 4e+128) || !(Float64(a - 0.5) <= 2e+176)))) tmp = Float64(a * b); else tmp = Float64(x + Float64(y + Float64(-0.5 * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((a - 0.5) <= -5e+212) || (~(((a - 0.5) <= 1e+30)) && (((a - 0.5) <= 4e+128) || ~(((a - 0.5) <= 2e+176))))) tmp = a * b; else tmp = x + (y + (-0.5 * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -5e+212], And[N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 1e+30]], $MachinePrecision], Or[LessEqual[N[(a - 0.5), $MachinePrecision], 4e+128], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 2e+176]], $MachinePrecision]]]], N[(a * b), $MachinePrecision], N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -5 \cdot 10^{+212} \lor \neg \left(a - 0.5 \leq 10^{+30}\right) \land \left(a - 0.5 \leq 4 \cdot 10^{+128} \lor \neg \left(a - 0.5 \leq 2 \cdot 10^{+176}\right)\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -4.99999999999999992e212 or 1e30 < (-.f64 a #s(literal 1/2 binary64)) < 4.0000000000000003e128 or 2e176 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 61.4%
*-commutative61.4%
Simplified61.4%
if -4.99999999999999992e212 < (-.f64 a #s(literal 1/2 binary64)) < 1e30 or 4.0000000000000003e128 < (-.f64 a #s(literal 1/2 binary64)) < 2e176Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 71.5%
Taylor expanded in a around 0 64.4%
Final simplification63.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= y -9.3e-144)
x
(if (<= y -1.85e-216)
t_1
(if (<= y 2.6e-283) x (if (<= y 4.7e+159) t_1 y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (y <= -9.3e-144) {
tmp = x;
} else if (y <= -1.85e-216) {
tmp = t_1;
} else if (y <= 2.6e-283) {
tmp = x;
} else if (y <= 4.7e+159) {
tmp = t_1;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if (y <= (-9.3d-144)) then
tmp = x
else if (y <= (-1.85d-216)) then
tmp = t_1
else if (y <= 2.6d-283) then
tmp = x
else if (y <= 4.7d+159) then
tmp = t_1
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (y <= -9.3e-144) {
tmp = x;
} else if (y <= -1.85e-216) {
tmp = t_1;
} else if (y <= 2.6e-283) {
tmp = x;
} else if (y <= 4.7e+159) {
tmp = t_1;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if y <= -9.3e-144: tmp = x elif y <= -1.85e-216: tmp = t_1 elif y <= 2.6e-283: tmp = x elif y <= 4.7e+159: tmp = t_1 else: tmp = y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (y <= -9.3e-144) tmp = x; elseif (y <= -1.85e-216) tmp = t_1; elseif (y <= 2.6e-283) tmp = x; elseif (y <= 4.7e+159) tmp = t_1; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if (y <= -9.3e-144) tmp = x; elseif (y <= -1.85e-216) tmp = t_1; elseif (y <= 2.6e-283) tmp = x; elseif (y <= 4.7e+159) tmp = t_1; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.3e-144], x, If[LessEqual[y, -1.85e-216], t$95$1, If[LessEqual[y, 2.6e-283], x, If[LessEqual[y, 4.7e+159], t$95$1, y]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;y \leq -9.3 \cdot 10^{-144}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.85 \cdot 10^{-216}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-283}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -9.3000000000000002e-144 or -1.84999999999999998e-216 < y < 2.6000000000000001e-283Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 18.8%
if -9.3000000000000002e-144 < y < -1.84999999999999998e-216 or 2.6000000000000001e-283 < y < 4.7000000000000003e159Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around inf 44.1%
if 4.7000000000000003e159 < y Initial program 99.9%
+-commutative99.9%
associate--l+100.0%
associate-+r+100.0%
+-commutative100.0%
*-lft-identity100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 67.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2e-206) x (if (<= y 1.5e+121) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2e-206) {
tmp = x;
} else if (y <= 1.5e+121) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 2d-206) then
tmp = x
else if (y <= 1.5d+121) then
tmp = a * b
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2e-206) {
tmp = x;
} else if (y <= 1.5e+121) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2e-206: tmp = x elif y <= 1.5e+121: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2e-206) tmp = x; elseif (y <= 1.5e+121) tmp = Float64(a * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 2e-206) tmp = x; elseif (y <= 1.5e+121) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2e-206], x, If[LessEqual[y, 1.5e+121], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{-206}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+121}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 2.00000000000000006e-206Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 20.6%
if 2.00000000000000006e-206 < y < 1.5000000000000001e121Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 30.5%
*-commutative30.5%
Simplified30.5%
if 1.5000000000000001e121 < y Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 60.9%
Final simplification30.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.5e+106) (+ x (* (+ a -0.5) b)) (+ y (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.5e+106) {
tmp = x + ((a + -0.5) * b);
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 1.5d+106) then
tmp = x + ((a + (-0.5d0)) * b)
else
tmp = y + (b * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.5e+106) {
tmp = x + ((a + -0.5) * b);
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.5e+106: tmp = x + ((a + -0.5) * b) else: tmp = y + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.5e+106) tmp = Float64(x + Float64(Float64(a + -0.5) * b)); else tmp = Float64(y + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.5e+106) tmp = x + ((a + -0.5) * b); else tmp = y + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.5e+106], N[(x + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{+106}:\\
\;\;\;\;x + \left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if y < 1.5e106Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around inf 75.6%
associate--l+75.6%
associate-/l*75.5%
Simplified75.5%
Taylor expanded in x around inf 44.5%
Taylor expanded in b around 0 53.5%
+-commutative53.5%
sub-neg53.5%
metadata-eval53.5%
Simplified53.5%
if 1.5e106 < y Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around inf 63.1%
associate--l+63.1%
associate-/l*63.1%
Simplified63.1%
Taylor expanded in y around inf 58.1%
Taylor expanded in b around 0 83.3%
Final simplification58.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.55e+113) (+ x (+ y (* -0.5 b))) (+ y (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.55e+113) {
tmp = x + (y + (-0.5 * b));
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-1.55d+113)) then
tmp = x + (y + ((-0.5d0) * b))
else
tmp = y + (b * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.55e+113) {
tmp = x + (y + (-0.5 * b));
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.55e+113: tmp = x + (y + (-0.5 * b)) else: tmp = y + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.55e+113) tmp = Float64(x + Float64(y + Float64(-0.5 * b))); else tmp = Float64(y + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.55e+113) tmp = x + (y + (-0.5 * b)); else tmp = y + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.55e+113], N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+113}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if x < -1.54999999999999996e113Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
associate-+r+100.0%
+-commutative100.0%
*-lft-identity100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 84.4%
Taylor expanded in a around 0 70.8%
if -1.54999999999999996e113 < x Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around inf 75.9%
associate--l+75.9%
associate-/l*75.9%
Simplified75.9%
Taylor expanded in y around inf 50.7%
Taylor expanded in b around 0 59.7%
(FPCore (x y z t a b) :precision binary64 (+ x (+ y (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
return x + (y + (b * (a - 0.5)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x + (y + (b * (a - 0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + (y + (b * (a - 0.5)));
}
def code(x, y, z, t, a, b): return x + (y + (b * (a - 0.5)))
function code(x, y, z, t, a, b) return Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))) end
function tmp = code(x, y, z, t, a, b) tmp = x + (y + (b * (a - 0.5))); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + b \cdot \left(a - 0.5\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 73.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.25e+118) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.25e+118) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 1.25d+118) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.25e+118) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.25e+118: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.25e+118) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.25e+118) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.25e+118], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{+118}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 1.24999999999999993e118Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 20.9%
if 1.24999999999999993e118 < y Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 60.9%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 18.9%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + y) + (((1.0d0 - (log(t) ** 2.0d0)) * z) / (1.0d0 + log(t)))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - Math.pow(Math.log(t), 2.0)) * z) / (1.0 + Math.log(t)))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return ((x + y) + (((1.0 - math.pow(math.log(t), 2.0)) * z) / (1.0 + math.log(t)))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + y) + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t)))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + y) + (((1.0 - (log(t) ^ 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(N[(N[(1.0 - N[Power[N[Log[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] / N[(1.0 + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b
\end{array}
herbie shell --seed 2024100
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))