
(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 (+ (* z (- 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 - log(t))) + fma((a + -0.5), b, (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z * 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[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)
\end{array}
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-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* b (- a 0.5)) (+ x y))) (t_2 (+ x (- z (* z (log t))))))
(if (<= z -5.6e+158)
t_2
(if (<= z 2.3e+88)
t_1
(if (<= z 4.4e+160)
(+ (* z (- 1.0 (log t))) y)
(if (<= z 2.1e+194)
t_1
(if (<= z 1.12e+227) (* z (- (+ 1.0 (/ y z)) (log t))) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * (a - 0.5)) + (x + y);
double t_2 = x + (z - (z * log(t)));
double tmp;
if (z <= -5.6e+158) {
tmp = t_2;
} else if (z <= 2.3e+88) {
tmp = t_1;
} else if (z <= 4.4e+160) {
tmp = (z * (1.0 - log(t))) + y;
} else if (z <= 2.1e+194) {
tmp = t_1;
} else if (z <= 1.12e+227) {
tmp = z * ((1.0 + (y / z)) - log(t));
} else {
tmp = t_2;
}
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 = (b * (a - 0.5d0)) + (x + y)
t_2 = x + (z - (z * log(t)))
if (z <= (-5.6d+158)) then
tmp = t_2
else if (z <= 2.3d+88) then
tmp = t_1
else if (z <= 4.4d+160) then
tmp = (z * (1.0d0 - log(t))) + y
else if (z <= 2.1d+194) then
tmp = t_1
else if (z <= 1.12d+227) then
tmp = z * ((1.0d0 + (y / z)) - log(t))
else
tmp = t_2
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)) + (x + y);
double t_2 = x + (z - (z * Math.log(t)));
double tmp;
if (z <= -5.6e+158) {
tmp = t_2;
} else if (z <= 2.3e+88) {
tmp = t_1;
} else if (z <= 4.4e+160) {
tmp = (z * (1.0 - Math.log(t))) + y;
} else if (z <= 2.1e+194) {
tmp = t_1;
} else if (z <= 1.12e+227) {
tmp = z * ((1.0 + (y / z)) - Math.log(t));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b * (a - 0.5)) + (x + y) t_2 = x + (z - (z * math.log(t))) tmp = 0 if z <= -5.6e+158: tmp = t_2 elif z <= 2.3e+88: tmp = t_1 elif z <= 4.4e+160: tmp = (z * (1.0 - math.log(t))) + y elif z <= 2.1e+194: tmp = t_1 elif z <= 1.12e+227: tmp = z * ((1.0 + (y / z)) - math.log(t)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b * Float64(a - 0.5)) + Float64(x + y)) t_2 = Float64(x + Float64(z - Float64(z * log(t)))) tmp = 0.0 if (z <= -5.6e+158) tmp = t_2; elseif (z <= 2.3e+88) tmp = t_1; elseif (z <= 4.4e+160) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + y); elseif (z <= 2.1e+194) tmp = t_1; elseif (z <= 1.12e+227) tmp = Float64(z * Float64(Float64(1.0 + Float64(y / z)) - log(t))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b * (a - 0.5)) + (x + y); t_2 = x + (z - (z * log(t))); tmp = 0.0; if (z <= -5.6e+158) tmp = t_2; elseif (z <= 2.3e+88) tmp = t_1; elseif (z <= 4.4e+160) tmp = (z * (1.0 - log(t))) + y; elseif (z <= 2.1e+194) tmp = t_1; elseif (z <= 1.12e+227) tmp = z * ((1.0 + (y / z)) - log(t)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.6e+158], t$95$2, If[LessEqual[z, 2.3e+88], t$95$1, If[LessEqual[z, 4.4e+160], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[z, 2.1e+194], t$95$1, If[LessEqual[z, 1.12e+227], N[(z * N[(N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision] - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right) + \left(x + y\right)\\
t_2 := x + \left(z - z \cdot \log t\right)\\
\mathbf{if}\;z \leq -5.6 \cdot 10^{+158}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+160}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + y\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+194}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{+227}:\\
\;\;\;\;z \cdot \left(\left(1 + \frac{y}{z}\right) - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -5.60000000000000003e158 or 1.1200000000000001e227 < z Initial program 99.5%
Taylor expanded in y around inf 60.9%
associate--l+60.9%
+-commutative60.9%
associate--l+60.9%
+-commutative60.9%
sub-neg60.9%
metadata-eval60.9%
associate-/l*60.9%
fma-define60.9%
associate-/l*60.6%
Simplified60.6%
Taylor expanded in y around 0 95.7%
associate--l+95.8%
sub-neg95.8%
metadata-eval95.8%
Simplified95.8%
Taylor expanded in b around 0 85.7%
if -5.60000000000000003e158 < z < 2.3000000000000002e88 or 4.39999999999999984e160 < z < 2.10000000000000016e194Initial program 99.9%
Taylor expanded in z around 0 93.3%
if 2.3000000000000002e88 < z < 4.39999999999999984e160Initial 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.6%
metadata-eval99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in b around 0 73.4%
Taylor expanded in x around 0 62.0%
if 2.10000000000000016e194 < z < 1.1200000000000001e227Initial 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.5%
metadata-eval99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in b around 0 99.5%
Taylor expanded in x around 0 89.1%
Taylor expanded in z around inf 89.1%
Final simplification89.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.65e+50) (not (<= z 6.5e+76))) (+ x (- (+ z (* (+ a -0.5) b)) (* z (log t)))) (+ (* b (- a 0.5)) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.65e+50) || !(z <= 6.5e+76)) {
tmp = x + ((z + ((a + -0.5) * b)) - (z * log(t)));
} else {
tmp = (b * (a - 0.5)) + (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 ((z <= (-1.65d+50)) .or. (.not. (z <= 6.5d+76))) then
tmp = x + ((z + ((a + (-0.5d0)) * b)) - (z * log(t)))
else
tmp = (b * (a - 0.5d0)) + (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 ((z <= -1.65e+50) || !(z <= 6.5e+76)) {
tmp = x + ((z + ((a + -0.5) * b)) - (z * Math.log(t)));
} else {
tmp = (b * (a - 0.5)) + (x + y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.65e+50) or not (z <= 6.5e+76): tmp = x + ((z + ((a + -0.5) * b)) - (z * math.log(t))) else: tmp = (b * (a - 0.5)) + (x + y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.65e+50) || !(z <= 6.5e+76)) tmp = Float64(x + Float64(Float64(z + Float64(Float64(a + -0.5) * b)) - Float64(z * log(t)))); else tmp = Float64(Float64(b * Float64(a - 0.5)) + Float64(x + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.65e+50) || ~((z <= 6.5e+76))) tmp = x + ((z + ((a + -0.5) * b)) - (z * log(t))); else tmp = (b * (a - 0.5)) + (x + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.65e+50], N[Not[LessEqual[z, 6.5e+76]], $MachinePrecision]], N[(x + N[(N[(z + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+50} \lor \neg \left(z \leq 6.5 \cdot 10^{+76}\right):\\
\;\;\;\;x + \left(\left(z + \left(a + -0.5\right) \cdot b\right) - z \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a - 0.5\right) + \left(x + y\right)\\
\end{array}
\end{array}
if z < -1.65e50 or 6.5000000000000005e76 < z Initial program 99.6%
Taylor expanded in y around inf 69.9%
associate--l+69.9%
+-commutative69.9%
associate--l+69.9%
+-commutative69.9%
sub-neg69.9%
metadata-eval69.9%
associate-/l*69.8%
fma-define69.8%
associate-/l*69.7%
Simplified69.7%
Taylor expanded in y around 0 88.7%
associate--l+88.8%
sub-neg88.8%
metadata-eval88.8%
Simplified88.8%
if -1.65e50 < z < 6.5000000000000005e76Initial program 100.0%
Taylor expanded in z around 0 98.7%
Final simplification94.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (* z (- 1.0 (log t)))))
(if (<= z -9.2e+51)
(+ x (+ t_2 y))
(if (<= z 9e+101) (+ t_1 (+ x y)) (+ t_2 t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = z * (1.0 - log(t));
double tmp;
if (z <= -9.2e+51) {
tmp = x + (t_2 + y);
} else if (z <= 9e+101) {
tmp = t_1 + (x + y);
} else {
tmp = t_2 + t_1;
}
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 = b * (a - 0.5d0)
t_2 = z * (1.0d0 - log(t))
if (z <= (-9.2d+51)) then
tmp = x + (t_2 + y)
else if (z <= 9d+101) then
tmp = t_1 + (x + y)
else
tmp = t_2 + t_1
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 t_2 = z * (1.0 - Math.log(t));
double tmp;
if (z <= -9.2e+51) {
tmp = x + (t_2 + y);
} else if (z <= 9e+101) {
tmp = t_1 + (x + y);
} else {
tmp = t_2 + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = z * (1.0 - math.log(t)) tmp = 0 if z <= -9.2e+51: tmp = x + (t_2 + y) elif z <= 9e+101: tmp = t_1 + (x + y) else: tmp = t_2 + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -9.2e+51) tmp = Float64(x + Float64(t_2 + y)); elseif (z <= 9e+101) tmp = Float64(t_1 + Float64(x + y)); else tmp = Float64(t_2 + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); t_2 = z * (1.0 - log(t)); tmp = 0.0; if (z <= -9.2e+51) tmp = x + (t_2 + y); elseif (z <= 9e+101) tmp = t_1 + (x + y); else tmp = t_2 + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9.2e+51], N[(x + N[(t$95$2 + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+101], N[(t$95$1 + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -9.2 \cdot 10^{+51}:\\
\;\;\;\;x + \left(t\_2 + y\right)\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+101}:\\
\;\;\;\;t\_1 + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + t\_1\\
\end{array}
\end{array}
if z < -9.2000000000000002e51Initial program 99.5%
+-commutative99.5%
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-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 80.5%
if -9.2000000000000002e51 < z < 9.0000000000000004e101Initial program 100.0%
Taylor expanded in z around 0 96.8%
if 9.0000000000000004e101 < z Initial program 99.6%
add-cube-cbrt98.1%
pow398.1%
associate--l+98.1%
associate-+r+98.1%
*-un-lft-identity98.1%
*-commutative98.1%
distribute-rgt-out--98.0%
Applied egg-rr98.0%
Taylor expanded in z around inf 84.8%
Final simplification91.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -9.5e+51) (not (<= z 1.25e+83))) (+ x (+ (* z (- 1.0 (log t))) y)) (+ (* b (- a 0.5)) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.5e+51) || !(z <= 1.25e+83)) {
tmp = x + ((z * (1.0 - log(t))) + y);
} else {
tmp = (b * (a - 0.5)) + (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 ((z <= (-9.5d+51)) .or. (.not. (z <= 1.25d+83))) then
tmp = x + ((z * (1.0d0 - log(t))) + y)
else
tmp = (b * (a - 0.5d0)) + (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 ((z <= -9.5e+51) || !(z <= 1.25e+83)) {
tmp = x + ((z * (1.0 - Math.log(t))) + y);
} else {
tmp = (b * (a - 0.5)) + (x + y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -9.5e+51) or not (z <= 1.25e+83): tmp = x + ((z * (1.0 - math.log(t))) + y) else: tmp = (b * (a - 0.5)) + (x + y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9.5e+51) || !(z <= 1.25e+83)) tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y)); else tmp = Float64(Float64(b * Float64(a - 0.5)) + Float64(x + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -9.5e+51) || ~((z <= 1.25e+83))) tmp = x + ((z * (1.0 - log(t))) + y); else tmp = (b * (a - 0.5)) + (x + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9.5e+51], N[Not[LessEqual[z, 1.25e+83]], $MachinePrecision]], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+51} \lor \neg \left(z \leq 1.25 \cdot 10^{+83}\right):\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a - 0.5\right) + \left(x + y\right)\\
\end{array}
\end{array}
if z < -9.4999999999999999e51 or 1.25000000000000007e83 < 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-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 79.4%
if -9.4999999999999999e51 < z < 1.25000000000000007e83Initial program 100.0%
Taylor expanded in z around 0 98.7%
Final simplification90.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.45e+159) (not (<= z 3.5e+147))) (+ x (- z (* z (log t)))) (+ (* b (- a 0.5)) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.45e+159) || !(z <= 3.5e+147)) {
tmp = x + (z - (z * log(t)));
} else {
tmp = (b * (a - 0.5)) + (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 ((z <= (-1.45d+159)) .or. (.not. (z <= 3.5d+147))) then
tmp = x + (z - (z * log(t)))
else
tmp = (b * (a - 0.5d0)) + (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 ((z <= -1.45e+159) || !(z <= 3.5e+147)) {
tmp = x + (z - (z * Math.log(t)));
} else {
tmp = (b * (a - 0.5)) + (x + y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.45e+159) or not (z <= 3.5e+147): tmp = x + (z - (z * math.log(t))) else: tmp = (b * (a - 0.5)) + (x + y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.45e+159) || !(z <= 3.5e+147)) tmp = Float64(x + Float64(z - Float64(z * log(t)))); else tmp = Float64(Float64(b * Float64(a - 0.5)) + Float64(x + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.45e+159) || ~((z <= 3.5e+147))) tmp = x + (z - (z * log(t))); else tmp = (b * (a - 0.5)) + (x + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.45e+159], N[Not[LessEqual[z, 3.5e+147]], $MachinePrecision]], N[(x + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+159} \lor \neg \left(z \leq 3.5 \cdot 10^{+147}\right):\\
\;\;\;\;x + \left(z - z \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a - 0.5\right) + \left(x + y\right)\\
\end{array}
\end{array}
if z < -1.45000000000000007e159 or 3.49999999999999975e147 < z Initial program 99.5%
Taylor expanded in y around inf 64.7%
associate--l+64.7%
+-commutative64.7%
associate--l+64.7%
+-commutative64.7%
sub-neg64.7%
metadata-eval64.7%
associate-/l*64.7%
fma-define64.7%
associate-/l*64.5%
Simplified64.5%
Taylor expanded in y around 0 92.4%
associate--l+92.4%
sub-neg92.4%
metadata-eval92.4%
Simplified92.4%
Taylor expanded in b around 0 78.5%
if -1.45000000000000007e159 < z < 3.49999999999999975e147Initial program 99.9%
Taylor expanded in z around 0 91.6%
Final simplification88.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.8%
Final simplification99.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.8e+162)
x
(if (or (<= x -2.35e-54) (and (not (<= x -7.3e-84)) (<= x 2.2e-307)))
(* a b)
y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.8e+162) {
tmp = x;
} else if ((x <= -2.35e-54) || (!(x <= -7.3e-84) && (x <= 2.2e-307))) {
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 <= (-1.8d+162)) then
tmp = x
else if ((x <= (-2.35d-54)) .or. (.not. (x <= (-7.3d-84))) .and. (x <= 2.2d-307)) 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 <= -1.8e+162) {
tmp = x;
} else if ((x <= -2.35e-54) || (!(x <= -7.3e-84) && (x <= 2.2e-307))) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.8e+162: tmp = x elif (x <= -2.35e-54) or (not (x <= -7.3e-84) and (x <= 2.2e-307)): tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.8e+162) tmp = x; elseif ((x <= -2.35e-54) || (!(x <= -7.3e-84) && (x <= 2.2e-307))) 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 <= -1.8e+162) tmp = x; elseif ((x <= -2.35e-54) || (~((x <= -7.3e-84)) && (x <= 2.2e-307))) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.8e+162], x, If[Or[LessEqual[x, -2.35e-54], And[N[Not[LessEqual[x, -7.3e-84]], $MachinePrecision], LessEqual[x, 2.2e-307]]], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+162}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2.35 \cdot 10^{-54} \lor \neg \left(x \leq -7.3 \cdot 10^{-84}\right) \land x \leq 2.2 \cdot 10^{-307}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.79999999999999997e162Initial 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 65.7%
if -1.79999999999999997e162 < x < -2.35e-54 or -7.3000000000000004e-84 < x < 2.2e-307Initial 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 31.5%
*-commutative31.5%
Simplified31.5%
if -2.35e-54 < x < -7.3000000000000004e-84 or 2.2e-307 < x Initial program 99.8%
+-commutative99.8%
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 y around inf 22.0%
Final simplification30.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -8.5e+132) (not (<= b 16000.0))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -8.5e+132) || !(b <= 16000.0)) {
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 <= (-8.5d+132)) .or. (.not. (b <= 16000.0d0))) 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 <= -8.5e+132) || !(b <= 16000.0)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -8.5e+132) or not (b <= 16000.0): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -8.5e+132) || !(b <= 16000.0)) 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 <= -8.5e+132) || ~((b <= 16000.0))) 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, -8.5e+132], N[Not[LessEqual[b, 16000.0]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.5 \cdot 10^{+132} \lor \neg \left(b \leq 16000\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -8.49999999999999969e132 or 16000 < 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-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 71.1%
if -8.49999999999999969e132 < b < 16000Initial 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 0 82.9%
Taylor expanded in z around 0 48.7%
+-commutative48.7%
Simplified48.7%
Final simplification56.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.8e+101) (not (<= a 3.7e+112))) (* a b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.8e+101) || !(a <= 3.7e+112)) {
tmp = a * b;
} 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 ((a <= (-1.8d+101)) .or. (.not. (a <= 3.7d+112))) then
tmp = a * b
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 ((a <= -1.8e+101) || !(a <= 3.7e+112)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.8e+101) or not (a <= 3.7e+112): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.8e+101) || !(a <= 3.7e+112)) tmp = Float64(a * b); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.8e+101) || ~((a <= 3.7e+112))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.8e+101], N[Not[LessEqual[a, 3.7e+112]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{+101} \lor \neg \left(a \leq 3.7 \cdot 10^{+112}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -1.80000000000000015e101 or 3.70000000000000004e112 < a Initial program 99.8%
+-commutative99.8%
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.9%
*-commutative61.9%
Simplified61.9%
if -1.80000000000000015e101 < a < 3.70000000000000004e112Initial 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 0 78.5%
Taylor expanded in z around 0 48.7%
+-commutative48.7%
Simplified48.7%
Final simplification53.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= y 2.02e+15) (+ x t_1) (+ y t_1))))
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 <= 2.02e+15) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
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 <= 2.02d+15) then
tmp = x + t_1
else
tmp = y + t_1
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 <= 2.02e+15) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if y <= 2.02e+15: tmp = x + t_1 else: tmp = y + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (y <= 2.02e+15) tmp = Float64(x + t_1); else tmp = Float64(y + t_1); 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 <= 2.02e+15) tmp = x + t_1; else tmp = y + t_1; 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, 2.02e+15], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;y \leq 2.02 \cdot 10^{+15}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if y < 2.02e15Initial program 99.8%
add-cube-cbrt98.7%
pow398.7%
associate--l+98.7%
associate-+r+98.7%
*-un-lft-identity98.7%
*-commutative98.7%
distribute-rgt-out--98.7%
Applied egg-rr98.7%
Taylor expanded in x around inf 62.6%
if 2.02e15 < y Initial program 99.8%
add-cube-cbrt98.0%
pow398.0%
associate--l+98.0%
associate-+r+98.0%
*-un-lft-identity98.0%
*-commutative98.0%
distribute-rgt-out--98.0%
Applied egg-rr98.0%
Taylor expanded in y around inf 67.8%
Final simplification63.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y 5.6e+26) (+ x (* b (- a 0.5))) (+ y (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 5.6e+26) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y + (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 (y <= 5.6d+26) then
tmp = x + (b * (a - 0.5d0))
else
tmp = y + (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 (y <= 5.6e+26) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 5.6e+26: tmp = x + (b * (a - 0.5)) else: tmp = y + (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 5.6e+26) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = Float64(y + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 5.6e+26) tmp = x + (b * (a - 0.5)); else tmp = y + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 5.6e+26], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.6 \cdot 10^{+26}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\
\end{array}
\end{array}
if y < 5.59999999999999999e26Initial program 99.8%
add-cube-cbrt98.7%
pow398.7%
associate--l+98.7%
associate-+r+98.7%
*-un-lft-identity98.7%
*-commutative98.7%
distribute-rgt-out--98.7%
Applied egg-rr98.7%
Taylor expanded in x around inf 62.4%
if 5.59999999999999999e26 < y Initial program 99.8%
Taylor expanded in y around inf 99.8%
associate--l+99.8%
+-commutative99.8%
associate--l+99.8%
+-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
associate-/l*99.8%
fma-define99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around inf 65.5%
associate-/l*65.5%
Simplified65.5%
Taylor expanded in y around 0 65.5%
*-commutative65.5%
Simplified65.5%
Final simplification63.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.5e+163) (+ x y) (+ y (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.5e+163) {
tmp = x + y;
} else {
tmp = y + (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 (x <= (-2.5d+163)) then
tmp = x + y
else
tmp = y + (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 (x <= -2.5e+163) {
tmp = x + y;
} else {
tmp = y + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.5e+163: tmp = x + y else: tmp = y + (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.5e+163) tmp = Float64(x + y); else tmp = Float64(y + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.5e+163) tmp = x + y; else tmp = y + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.5e+163], N[(x + y), $MachinePrecision], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+163}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\
\end{array}
\end{array}
if x < -2.5e163Initial 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 b around 0 90.8%
Taylor expanded in z around 0 76.7%
+-commutative76.7%
Simplified76.7%
if -2.5e163 < x Initial program 99.8%
Taylor expanded in y around inf 78.5%
associate--l+78.5%
+-commutative78.5%
associate--l+78.5%
+-commutative78.5%
sub-neg78.5%
metadata-eval78.5%
associate-/l*73.8%
fma-define73.8%
associate-/l*73.8%
Simplified73.8%
Taylor expanded in a around inf 48.4%
associate-/l*48.4%
Simplified48.4%
Taylor expanded in y around 0 52.4%
*-commutative52.4%
Simplified52.4%
Final simplification55.0%
(FPCore (x y z t a b) :precision binary64 (+ (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (x + y);
}
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 = (b * (a - 0.5d0)) + (x + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (x + y);
}
def code(x, y, z, t, a, b): return (b * (a - 0.5)) + (x + y)
function code(x, y, z, t, a, b) return Float64(Float64(b * Float64(a - 0.5)) + Float64(x + y)) end
function tmp = code(x, y, z, t, a, b) tmp = (b * (a - 0.5)) + (x + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(a - 0.5\right) + \left(x + y\right)
\end{array}
Initial program 99.8%
Taylor expanded in z around 0 74.8%
Final simplification74.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2.1e+15) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.1e+15) {
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 <= 2.1d+15) 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 <= 2.1e+15) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.1e+15: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.1e+15) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 2.1e+15) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.1e+15], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1 \cdot 10^{+15}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 2.1e15Initial 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-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 22.4%
if 2.1e15 < 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.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 45.2%
(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.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-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 20.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 2024102
(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)))