
(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 18 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 (+ (/ z (/ 1.0 (- 1.0 (log t)))) (fma (+ a -0.5) b (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (z / (1.0 / (1.0 - log(t)))) + fma((a + -0.5), b, (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z / Float64(1.0 / Float64(1.0 - log(t)))) + fma(Float64(a + -0.5), b, Float64(x + y))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z / N[(1.0 / N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z}{\frac{1}{1 - \log t}} + \mathsf{fma}\left(a + -0.5, b, x + y\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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
flip--99.9%
associate-*r/99.2%
metadata-eval99.2%
pow299.2%
Applied egg-rr99.2%
associate-/l*99.9%
Simplified99.9%
expm1-log1p-u99.9%
expm1-udef98.1%
clear-num98.1%
metadata-eval98.1%
unpow298.1%
flip--98.1%
Applied egg-rr98.1%
expm1-def99.9%
expm1-log1p99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (+ (fma (+ a -0.5) b (+ x y)) (* z (- 1.0 (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 * (1.0 - log(t)));
}
function code(x, y, z, t, a, b) return Float64(fma(Float64(a + -0.5), b, Float64(x + y)) + Float64(z * Float64(1.0 - log(t)))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, b, x + y\right) + z \cdot \left(1 - \log t\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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))) (t_2 (* b (- a 0.5))))
(if (<= t_2 -2e+221)
(+ t_2 (- z t_1))
(if (<= t_2 1e+156)
(+ (- (+ z (+ x y)) t_1) (* -0.5 b))
(+ x (+ y (+ (* -0.5 b) (* a b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double t_2 = b * (a - 0.5);
double tmp;
if (t_2 <= -2e+221) {
tmp = t_2 + (z - t_1);
} else if (t_2 <= 1e+156) {
tmp = ((z + (x + y)) - t_1) + (-0.5 * b);
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * log(t)
t_2 = b * (a - 0.5d0)
if (t_2 <= (-2d+221)) then
tmp = t_2 + (z - t_1)
else if (t_2 <= 1d+156) then
tmp = ((z + (x + y)) - t_1) + ((-0.5d0) * b)
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 t_1 = z * Math.log(t);
double t_2 = b * (a - 0.5);
double tmp;
if (t_2 <= -2e+221) {
tmp = t_2 + (z - t_1);
} else if (t_2 <= 1e+156) {
tmp = ((z + (x + y)) - t_1) + (-0.5 * b);
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) t_2 = b * (a - 0.5) tmp = 0 if t_2 <= -2e+221: tmp = t_2 + (z - t_1) elif t_2 <= 1e+156: tmp = ((z + (x + y)) - t_1) + (-0.5 * b) else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) t_2 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (t_2 <= -2e+221) tmp = Float64(t_2 + Float64(z - t_1)); elseif (t_2 <= 1e+156) tmp = Float64(Float64(Float64(z + Float64(x + y)) - t_1) + Float64(-0.5 * b)); 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) t_1 = z * log(t); t_2 = b * (a - 0.5); tmp = 0.0; if (t_2 <= -2e+221) tmp = t_2 + (z - t_1); elseif (t_2 <= 1e+156) tmp = ((z + (x + y)) - t_1) + (-0.5 * b); else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+221], N[(t$95$2 + N[(z - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+156], N[(N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(-0.5 * b), $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}
t_1 := z \cdot \log t\\
t_2 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{+221}:\\
\;\;\;\;t_2 + \left(z - t_1\right)\\
\mathbf{elif}\;t_2 \leq 10^{+156}:\\
\;\;\;\;\left(\left(z + \left(x + y\right)\right) - t_1\right) + -0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -2.0000000000000001e221Initial program 100.0%
Taylor expanded in z around inf 97.2%
if -2.0000000000000001e221 < (*.f64 (-.f64 a 1/2) b) < 9.9999999999999998e155Initial program 99.8%
Taylor expanded in a around 0 96.0%
*-commutative96.0%
Simplified96.0%
if 9.9999999999999998e155 < (*.f64 (-.f64 a 1/2) b) 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 93.8%
associate-+r+93.8%
sub-neg93.8%
metadata-eval93.8%
*-commutative93.8%
associate-+l+93.8%
+-commutative93.8%
fma-def93.8%
Simplified93.8%
Taylor expanded in a around 0 93.8%
Final simplification95.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.3e+161) (not (<= z 1.85e+151))) (+ (* b (- a 0.5)) (- z (* z (log t)))) (+ x (fma (+ a -0.5) b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.3e+161) || !(z <= 1.85e+151)) {
tmp = (b * (a - 0.5)) + (z - (z * log(t)));
} else {
tmp = x + fma((a + -0.5), b, y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.3e+161) || !(z <= 1.85e+151)) tmp = Float64(Float64(b * Float64(a - 0.5)) + Float64(z - Float64(z * log(t)))); else tmp = Float64(x + fma(Float64(a + -0.5), b, y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.3e+161], N[Not[LessEqual[z, 1.85e+151]], $MachinePrecision]], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a + -0.5), $MachinePrecision] * b + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.3 \cdot 10^{+161} \lor \neg \left(z \leq 1.85 \cdot 10^{+151}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right) + \left(z - z \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(a + -0.5, b, y\right)\\
\end{array}
\end{array}
if z < -8.30000000000000016e161 or 1.8499999999999999e151 < z Initial program 99.6%
Taylor expanded in z around inf 90.7%
if -8.30000000000000016e161 < z < 1.8499999999999999e151Initial 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-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 94.5%
associate-+r+94.5%
sub-neg94.5%
metadata-eval94.5%
*-commutative94.5%
associate-+l+94.5%
+-commutative94.5%
fma-def94.6%
Simplified94.6%
Final simplification93.6%
(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 (<= z -1.4e+101) (not (<= z 3.6e+191))) (+ (+ x y) (* z (- 1.0 (log t)))) (+ x (fma (+ a -0.5) b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.4e+101) || !(z <= 3.6e+191)) {
tmp = (x + y) + (z * (1.0 - log(t)));
} else {
tmp = x + fma((a + -0.5), b, y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.4e+101) || !(z <= 3.6e+191)) tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(x + fma(Float64(a + -0.5), b, y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.4e+101], N[Not[LessEqual[z, 3.6e+191]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a + -0.5), $MachinePrecision] * b + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+101} \lor \neg \left(z \leq 3.6 \cdot 10^{+191}\right):\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(a + -0.5, b, y\right)\\
\end{array}
\end{array}
if z < -1.39999999999999991e101 or 3.5999999999999999e191 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 86.2%
if -1.39999999999999991e101 < z < 3.5999999999999999e191Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 93.1%
associate-+r+93.1%
sub-neg93.1%
metadata-eval93.1%
*-commutative93.1%
associate-+l+93.1%
+-commutative93.1%
fma-def93.1%
Simplified93.1%
Final simplification91.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.15e+162) (not (<= z 2.4e+190))) (+ x (* z (- 1.0 (log t)))) (+ x (+ y (* b (- a 0.5))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.15e+162) || !(z <= 2.4e+190)) {
tmp = x + (z * (1.0 - log(t)));
} else {
tmp = x + (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 ((z <= (-2.15d+162)) .or. (.not. (z <= 2.4d+190))) then
tmp = x + (z * (1.0d0 - log(t)))
else
tmp = x + (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 ((z <= -2.15e+162) || !(z <= 2.4e+190)) {
tmp = x + (z * (1.0 - Math.log(t)));
} else {
tmp = x + (y + (b * (a - 0.5)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.15e+162) or not (z <= 2.4e+190): tmp = x + (z * (1.0 - math.log(t))) else: tmp = x + (y + (b * (a - 0.5))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.15e+162) || !(z <= 2.4e+190)) tmp = Float64(x + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(x + 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 ((z <= -2.15e+162) || ~((z <= 2.4e+190))) tmp = x + (z * (1.0 - log(t))); else tmp = x + (y + (b * (a - 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.15e+162], N[Not[LessEqual[z, 2.4e+190]], $MachinePrecision]], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+162} \lor \neg \left(z \leq 2.4 \cdot 10^{+190}\right):\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\end{array}
\end{array}
if z < -2.1500000000000001e162 or 2.3999999999999999e190 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in b around 0 84.8%
Taylor expanded in y around 0 77.9%
if -2.1500000000000001e162 < z < 2.3999999999999999e190Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 92.8%
Final simplification89.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.1e+162) (not (<= z 6.4e+190))) (+ x (* z (- 1.0 (log t)))) (+ x (fma (+ a -0.5) b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.1e+162) || !(z <= 6.4e+190)) {
tmp = x + (z * (1.0 - log(t)));
} else {
tmp = x + fma((a + -0.5), b, y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.1e+162) || !(z <= 6.4e+190)) tmp = Float64(x + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(x + fma(Float64(a + -0.5), b, y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.1e+162], N[Not[LessEqual[z, 6.4e+190]], $MachinePrecision]], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(a + -0.5), $MachinePrecision] * b + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+162} \lor \neg \left(z \leq 6.4 \cdot 10^{+190}\right):\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(a + -0.5, b, y\right)\\
\end{array}
\end{array}
if z < -3.1e162 or 6.4000000000000001e190 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in b around 0 84.8%
Taylor expanded in y around 0 77.9%
if -3.1e162 < z < 6.4000000000000001e190Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 92.8%
associate-+r+92.8%
sub-neg92.8%
metadata-eval92.8%
*-commutative92.8%
associate-+l+92.8%
+-commutative92.8%
fma-def92.8%
Simplified92.8%
Final simplification89.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -3.05e+162)
(+ x t_1)
(if (<= z 1.55e+192) (+ x (fma (+ a -0.5) b y)) (+ y t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - log(t));
double tmp;
if (z <= -3.05e+162) {
tmp = x + t_1;
} else if (z <= 1.55e+192) {
tmp = x + fma((a + -0.5), b, y);
} else {
tmp = y + t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -3.05e+162) tmp = Float64(x + t_1); elseif (z <= 1.55e+192) tmp = Float64(x + fma(Float64(a + -0.5), b, y)); else tmp = Float64(y + t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.05e+162], N[(x + t$95$1), $MachinePrecision], If[LessEqual[z, 1.55e+192], N[(x + N[(N[(a + -0.5), $MachinePrecision] * b + y), $MachinePrecision]), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -3.05 \cdot 10^{+162}:\\
\;\;\;\;x + t_1\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+192}:\\
\;\;\;\;x + \mathsf{fma}\left(a + -0.5, b, y\right)\\
\mathbf{else}:\\
\;\;\;\;y + t_1\\
\end{array}
\end{array}
if z < -3.0499999999999999e162Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
associate-+r+99.5%
+-commutative99.5%
*-lft-identity99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in b around 0 84.4%
Taylor expanded in y around 0 84.4%
if -3.0499999999999999e162 < z < 1.5499999999999999e192Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 92.8%
associate-+r+92.8%
sub-neg92.8%
metadata-eval92.8%
*-commutative92.8%
associate-+l+92.8%
+-commutative92.8%
fma-def92.8%
Simplified92.8%
if 1.5499999999999999e192 < 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.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 85.2%
Taylor expanded in x around 0 81.8%
*-commutative81.8%
Simplified81.8%
Final simplification90.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.1e+162) (not (<= z 1.1e+191))) (* z (- 1.0 (log t))) (+ x (+ y (* b (- a 0.5))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.1e+162) || !(z <= 1.1e+191)) {
tmp = z * (1.0 - log(t));
} else {
tmp = x + (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 ((z <= (-3.1d+162)) .or. (.not. (z <= 1.1d+191))) then
tmp = z * (1.0d0 - log(t))
else
tmp = x + (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 ((z <= -3.1e+162) || !(z <= 1.1e+191)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = x + (y + (b * (a - 0.5)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.1e+162) or not (z <= 1.1e+191): tmp = z * (1.0 - math.log(t)) else: tmp = x + (y + (b * (a - 0.5))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.1e+162) || !(z <= 1.1e+191)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(x + 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 ((z <= -3.1e+162) || ~((z <= 1.1e+191))) tmp = z * (1.0 - log(t)); else tmp = x + (y + (b * (a - 0.5))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.1e+162], N[Not[LessEqual[z, 1.1e+191]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+162} \lor \neg \left(z \leq 1.1 \cdot 10^{+191}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\end{array}
\end{array}
if z < -3.1e162 or 1.1e191 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
*-commutative99.6%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 74.4%
if -3.1e162 < z < 1.1e191Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 92.8%
Final simplification88.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -3e+162)
x
(if (<= x -8.5e+113)
(* a b)
(if (<= x -1.3e+92) x (if (<= x -0.0014) (* a b) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3e+162) {
tmp = x;
} else if (x <= -8.5e+113) {
tmp = a * b;
} else if (x <= -1.3e+92) {
tmp = x;
} else if (x <= -0.0014) {
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 (x <= (-3d+162)) then
tmp = x
else if (x <= (-8.5d+113)) then
tmp = a * b
else if (x <= (-1.3d+92)) then
tmp = x
else if (x <= (-0.0014d0)) 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 (x <= -3e+162) {
tmp = x;
} else if (x <= -8.5e+113) {
tmp = a * b;
} else if (x <= -1.3e+92) {
tmp = x;
} else if (x <= -0.0014) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3e+162: tmp = x elif x <= -8.5e+113: tmp = a * b elif x <= -1.3e+92: tmp = x elif x <= -0.0014: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3e+162) tmp = x; elseif (x <= -8.5e+113) tmp = Float64(a * b); elseif (x <= -1.3e+92) tmp = x; elseif (x <= -0.0014) 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 (x <= -3e+162) tmp = x; elseif (x <= -8.5e+113) tmp = a * b; elseif (x <= -1.3e+92) tmp = x; elseif (x <= -0.0014) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3e+162], x, If[LessEqual[x, -8.5e+113], N[(a * b), $MachinePrecision], If[LessEqual[x, -1.3e+92], x, If[LessEqual[x, -0.0014], N[(a * b), $MachinePrecision], y]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+162}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{+113}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \leq -1.3 \cdot 10^{+92}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -0.0014:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -2.9999999999999998e162 or -8.5000000000000001e113 < x < -1.2999999999999999e92Initial 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-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 63.5%
if -2.9999999999999998e162 < x < -8.5000000000000001e113 or -1.2999999999999999e92 < x < -0.00139999999999999999Initial 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.6%
metadata-eval99.6%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in a around inf 40.7%
*-commutative40.7%
Simplified40.7%
if -0.00139999999999999999 < 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.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 23.2%
Final simplification31.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.4e+138)
(* a b)
(if (<= a -1.22e-128)
(+ x y)
(if (<= a -7.5e-200) (* -0.5 b) (if (<= a 1.55e+121) (+ x y) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.4e+138) {
tmp = a * b;
} else if (a <= -1.22e-128) {
tmp = x + y;
} else if (a <= -7.5e-200) {
tmp = -0.5 * b;
} else if (a <= 1.55e+121) {
tmp = x + y;
} else {
tmp = 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 (a <= (-1.4d+138)) then
tmp = a * b
else if (a <= (-1.22d-128)) then
tmp = x + y
else if (a <= (-7.5d-200)) then
tmp = (-0.5d0) * b
else if (a <= 1.55d+121) then
tmp = x + y
else
tmp = 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 (a <= -1.4e+138) {
tmp = a * b;
} else if (a <= -1.22e-128) {
tmp = x + y;
} else if (a <= -7.5e-200) {
tmp = -0.5 * b;
} else if (a <= 1.55e+121) {
tmp = x + y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.4e+138: tmp = a * b elif a <= -1.22e-128: tmp = x + y elif a <= -7.5e-200: tmp = -0.5 * b elif a <= 1.55e+121: tmp = x + y else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.4e+138) tmp = Float64(a * b); elseif (a <= -1.22e-128) tmp = Float64(x + y); elseif (a <= -7.5e-200) tmp = Float64(-0.5 * b); elseif (a <= 1.55e+121) tmp = Float64(x + y); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.4e+138) tmp = a * b; elseif (a <= -1.22e-128) tmp = x + y; elseif (a <= -7.5e-200) tmp = -0.5 * b; elseif (a <= 1.55e+121) tmp = x + y; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.4e+138], N[(a * b), $MachinePrecision], If[LessEqual[a, -1.22e-128], N[(x + y), $MachinePrecision], If[LessEqual[a, -7.5e-200], N[(-0.5 * b), $MachinePrecision], If[LessEqual[a, 1.55e+121], N[(x + y), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+138}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \leq -1.22 \cdot 10^{-128}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -7.5 \cdot 10^{-200}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+121}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if a < -1.4e138 or 1.55000000000000004e121 < a 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 62.6%
*-commutative62.6%
Simplified62.6%
if -1.4e138 < a < -1.22e-128 or -7.49999999999999958e-200 < a < 1.55000000000000004e121Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 75.8%
associate-+r+75.8%
sub-neg75.8%
metadata-eval75.8%
*-commutative75.8%
associate-+l+75.8%
+-commutative75.8%
fma-def75.8%
Simplified75.8%
Taylor expanded in b around 0 55.9%
if -1.22e-128 < a < -7.49999999999999958e-200Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around inf 50.0%
Taylor expanded in a around 0 50.0%
Final simplification57.4%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -1e+74) (+ x (* -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 + y) <= -1e+74) {
tmp = x + (-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 + y) <= (-1d+74)) then
tmp = x + ((-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 + y) <= -1e+74) {
tmp = x + (-0.5 * b);
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -1e+74: tmp = x + (-0.5 * b) else: tmp = y + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -1e+74) tmp = Float64(x + 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 + y) <= -1e+74) tmp = x + (-0.5 * b); else tmp = y + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -1e+74], N[(x + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{+74}:\\
\;\;\;\;x + -0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -9.99999999999999952e73Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 86.8%
associate-+r+86.8%
sub-neg86.8%
metadata-eval86.8%
*-commutative86.8%
associate-+l+86.8%
+-commutative86.8%
fma-def86.8%
Simplified86.8%
Taylor expanded in a around 0 86.8%
Taylor expanded in y around 0 62.7%
Taylor expanded in a around 0 47.6%
if -9.99999999999999952e73 < (+.f64 x y) Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 74.2%
associate-+r+74.2%
sub-neg74.2%
metadata-eval74.2%
*-commutative74.2%
associate-+l+74.2%
+-commutative74.2%
fma-def74.2%
Simplified74.2%
Taylor expanded in x around 0 53.5%
Final simplification51.7%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -1e+74) (+ (+ 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 + y) <= -1e+74) {
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 + y) <= (-1d+74)) 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 + y) <= -1e+74) {
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 + y) <= -1e+74: 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 (Float64(x + y) <= -1e+74) tmp = Float64(Float64(x + 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 + y) <= -1e+74) 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[N[(x + y), $MachinePrecision], -1e+74], N[(N[(x + y), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -1 \cdot 10^{+74}:\\
\;\;\;\;\left(x + y\right) + -0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -9.99999999999999952e73Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 86.8%
associate-+r+86.8%
sub-neg86.8%
metadata-eval86.8%
*-commutative86.8%
associate-+l+86.8%
+-commutative86.8%
fma-def86.8%
Simplified86.8%
Taylor expanded in a around 0 71.9%
associate-+r+71.9%
*-commutative71.9%
Simplified71.9%
if -9.99999999999999952e73 < (+.f64 x y) Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 74.2%
associate-+r+74.2%
sub-neg74.2%
metadata-eval74.2%
*-commutative74.2%
associate-+l+74.2%
+-commutative74.2%
fma-def74.2%
Simplified74.2%
Taylor expanded in x around 0 53.5%
Final simplification59.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.2e+27) (not (<= b 1.4e+80))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.2e+27) || !(b <= 1.4e+80)) {
tmp = b * (a - 0.5);
} else {
tmp = x + 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 ((b <= (-2.2d+27)) .or. (.not. (b <= 1.4d+80))) then
tmp = b * (a - 0.5d0)
else
tmp = x + 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 ((b <= -2.2e+27) || !(b <= 1.4e+80)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.2e+27) or not (b <= 1.4e+80): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.2e+27) || !(b <= 1.4e+80)) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -2.2e+27) || ~((b <= 1.4e+80))) tmp = b * (a - 0.5); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.2e+27], N[Not[LessEqual[b, 1.4e+80]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.2 \cdot 10^{+27} \lor \neg \left(b \leq 1.4 \cdot 10^{+80}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -2.1999999999999999e27 or 1.39999999999999992e80 < b 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 65.3%
if -2.1999999999999999e27 < b < 1.39999999999999992e80Initial 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.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 73.1%
associate-+r+73.1%
sub-neg73.1%
metadata-eval73.1%
*-commutative73.1%
associate-+l+73.1%
+-commutative73.1%
fma-def73.1%
Simplified73.1%
Taylor expanded in b around 0 65.4%
Final simplification65.4%
(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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 78.1%
Final simplification78.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.05e+60) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.05e+60) {
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 (x <= (-1.05d+60)) 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 (x <= -1.05e+60) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.05e+60: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.05e+60) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.05e+60) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.05e+60], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+60}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.0500000000000001e60Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 56.5%
if -1.0500000000000001e60 < x Initial 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.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 22.9%
Final simplification29.6%
(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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 27.0%
Final simplification27.0%
(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 2023310
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ (+ (+ 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)))