
(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 19 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 (* z (log t))))
(if (<= (+ x y) -5e+196)
(* x (+ 1.0 (+ (/ y x) (* b (/ (+ a -0.5) x)))))
(if (<= (+ x y) -2e+138)
(- (+ (+ z x) (* -0.5 b)) t_1)
(if (<= (+ x y) -5e+34)
(+ x (+ y (* (+ a -0.5) b)))
(- (+ y (+ z (* b (- a 0.5)))) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double tmp;
if ((x + y) <= -5e+196) {
tmp = x * (1.0 + ((y / x) + (b * ((a + -0.5) / x))));
} else if ((x + y) <= -2e+138) {
tmp = ((z + x) + (-0.5 * b)) - t_1;
} else if ((x + y) <= -5e+34) {
tmp = x + (y + ((a + -0.5) * b));
} else {
tmp = (y + (z + (b * (a - 0.5)))) - 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 = z * log(t)
if ((x + y) <= (-5d+196)) then
tmp = x * (1.0d0 + ((y / x) + (b * ((a + (-0.5d0)) / x))))
else if ((x + y) <= (-2d+138)) then
tmp = ((z + x) + ((-0.5d0) * b)) - t_1
else if ((x + y) <= (-5d+34)) then
tmp = x + (y + ((a + (-0.5d0)) * b))
else
tmp = (y + (z + (b * (a - 0.5d0)))) - 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 = z * Math.log(t);
double tmp;
if ((x + y) <= -5e+196) {
tmp = x * (1.0 + ((y / x) + (b * ((a + -0.5) / x))));
} else if ((x + y) <= -2e+138) {
tmp = ((z + x) + (-0.5 * b)) - t_1;
} else if ((x + y) <= -5e+34) {
tmp = x + (y + ((a + -0.5) * b));
} else {
tmp = (y + (z + (b * (a - 0.5)))) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) tmp = 0 if (x + y) <= -5e+196: tmp = x * (1.0 + ((y / x) + (b * ((a + -0.5) / x)))) elif (x + y) <= -2e+138: tmp = ((z + x) + (-0.5 * b)) - t_1 elif (x + y) <= -5e+34: tmp = x + (y + ((a + -0.5) * b)) else: tmp = (y + (z + (b * (a - 0.5)))) - t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) tmp = 0.0 if (Float64(x + y) <= -5e+196) tmp = Float64(x * Float64(1.0 + Float64(Float64(y / x) + Float64(b * Float64(Float64(a + -0.5) / x))))); elseif (Float64(x + y) <= -2e+138) tmp = Float64(Float64(Float64(z + x) + Float64(-0.5 * b)) - t_1); elseif (Float64(x + y) <= -5e+34) tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); else tmp = Float64(Float64(y + Float64(z + Float64(b * Float64(a - 0.5)))) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * log(t); tmp = 0.0; if ((x + y) <= -5e+196) tmp = x * (1.0 + ((y / x) + (b * ((a + -0.5) / x)))); elseif ((x + y) <= -2e+138) tmp = ((z + x) + (-0.5 * b)) - t_1; elseif ((x + y) <= -5e+34) tmp = x + (y + ((a + -0.5) * b)); else tmp = (y + (z + (b * (a - 0.5)))) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -5e+196], N[(x * N[(1.0 + N[(N[(y / x), $MachinePrecision] + N[(b * N[(N[(a + -0.5), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], -2e+138], N[(N[(N[(z + x), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[N[(x + y), $MachinePrecision], -5e+34], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + N[(z + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
\mathbf{if}\;x + y \leq -5 \cdot 10^{+196}:\\
\;\;\;\;x \cdot \left(1 + \left(\frac{y}{x} + b \cdot \frac{a + -0.5}{x}\right)\right)\\
\mathbf{elif}\;x + y \leq -2 \cdot 10^{+138}:\\
\;\;\;\;\left(\left(z + x\right) + -0.5 \cdot b\right) - t\_1\\
\mathbf{elif}\;x + y \leq -5 \cdot 10^{+34}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(z + b \cdot \left(a - 0.5\right)\right)\right) - t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < -4.9999999999999998e196Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 90.5%
distribute-rgt-out90.5%
Simplified90.5%
Taylor expanded in x around inf 68.3%
associate-/l*68.2%
sub-neg68.2%
metadata-eval68.2%
Simplified68.2%
if -4.9999999999999998e196 < (+.f64 x y) < -2.0000000000000001e138Initial program 99.7%
Taylor expanded in y around 0 83.0%
associate-+r+83.0%
+-commutative83.0%
sub-neg83.0%
metadata-eval83.0%
+-commutative83.0%
Simplified83.0%
Taylor expanded in a around 0 83.0%
*-commutative83.0%
Simplified83.0%
if -2.0000000000000001e138 < (+.f64 x y) < -4.9999999999999998e34Initial program 99.7%
Taylor expanded in a around 0 99.7%
Taylor expanded in z around 0 81.3%
distribute-rgt-out81.3%
Simplified81.3%
if -4.9999999999999998e34 < (+.f64 x y) Initial program 99.8%
Taylor expanded in x around 0 86.4%
Final simplification82.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))))
(if (<= (+ x y) -5e-115)
(- (+ (+ z x) (* (+ a -0.5) b)) t_1)
(- (+ y (+ z (* b (- a 0.5)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double tmp;
if ((x + y) <= -5e-115) {
tmp = ((z + x) + ((a + -0.5) * b)) - t_1;
} else {
tmp = (y + (z + (b * (a - 0.5)))) - 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 = z * log(t)
if ((x + y) <= (-5d-115)) then
tmp = ((z + x) + ((a + (-0.5d0)) * b)) - t_1
else
tmp = (y + (z + (b * (a - 0.5d0)))) - 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 = z * Math.log(t);
double tmp;
if ((x + y) <= -5e-115) {
tmp = ((z + x) + ((a + -0.5) * b)) - t_1;
} else {
tmp = (y + (z + (b * (a - 0.5)))) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) tmp = 0 if (x + y) <= -5e-115: tmp = ((z + x) + ((a + -0.5) * b)) - t_1 else: tmp = (y + (z + (b * (a - 0.5)))) - t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) tmp = 0.0 if (Float64(x + y) <= -5e-115) tmp = Float64(Float64(Float64(z + x) + Float64(Float64(a + -0.5) * b)) - t_1); else tmp = Float64(Float64(y + Float64(z + Float64(b * Float64(a - 0.5)))) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * log(t); tmp = 0.0; if ((x + y) <= -5e-115) tmp = ((z + x) + ((a + -0.5) * b)) - t_1; else tmp = (y + (z + (b * (a - 0.5)))) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -5e-115], N[(N[(N[(z + x), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(y + N[(z + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
\mathbf{if}\;x + y \leq -5 \cdot 10^{-115}:\\
\;\;\;\;\left(\left(z + x\right) + \left(a + -0.5\right) \cdot b\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(z + b \cdot \left(a - 0.5\right)\right)\right) - t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < -5.0000000000000003e-115Initial program 99.8%
Taylor expanded in y around 0 82.0%
associate-+r+82.1%
+-commutative82.1%
sub-neg82.1%
metadata-eval82.1%
+-commutative82.1%
Simplified82.1%
if -5.0000000000000003e-115 < (+.f64 x y) Initial program 99.8%
Taylor expanded in x around 0 84.4%
Final simplification83.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.2e-85) (not (<= b 8.4e-5))) (+ x (+ y (* (+ a -0.5) b))) (+ (* z (- 1.0 (log t))) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.2e-85) || !(b <= 8.4e-5)) {
tmp = x + (y + ((a + -0.5) * b));
} else {
tmp = (z * (1.0 - log(t))) + (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 <= (-1.2d-85)) .or. (.not. (b <= 8.4d-5))) then
tmp = x + (y + ((a + (-0.5d0)) * b))
else
tmp = (z * (1.0d0 - log(t))) + (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 <= -1.2e-85) || !(b <= 8.4e-5)) {
tmp = x + (y + ((a + -0.5) * b));
} else {
tmp = (z * (1.0 - Math.log(t))) + (x + y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.2e-85) or not (b <= 8.4e-5): tmp = x + (y + ((a + -0.5) * b)) else: tmp = (z * (1.0 - math.log(t))) + (x + y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.2e-85) || !(b <= 8.4e-5)) tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); else tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(x + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.2e-85) || ~((b <= 8.4e-5))) tmp = x + (y + ((a + -0.5) * b)); else tmp = (z * (1.0 - log(t))) + (x + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.2e-85], N[Not[LessEqual[b, 8.4e-5]], $MachinePrecision]], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.2 \cdot 10^{-85} \lor \neg \left(b \leq 8.4 \cdot 10^{-5}\right):\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + \left(x + y\right)\\
\end{array}
\end{array}
if b < -1.2e-85 or 8.39999999999999954e-5 < b Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 89.2%
distribute-rgt-out89.2%
Simplified89.2%
if -1.2e-85 < b < 8.39999999999999954e-5Initial 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.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 89.5%
Final simplification89.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.6e+189) (not (<= z 3.9e+202))) (+ (* z (- 1.0 (log t))) x) (+ x (+ y (* (+ a -0.5) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.6e+189) || !(z <= 3.9e+202)) {
tmp = (z * (1.0 - log(t))) + x;
} else {
tmp = x + (y + ((a + -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 ((z <= (-1.6d+189)) .or. (.not. (z <= 3.9d+202))) then
tmp = (z * (1.0d0 - log(t))) + x
else
tmp = x + (y + ((a + (-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 ((z <= -1.6e+189) || !(z <= 3.9e+202)) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.6e+189) or not (z <= 3.9e+202): tmp = (z * (1.0 - math.log(t))) + x else: tmp = x + (y + ((a + -0.5) * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.6e+189) || !(z <= 3.9e+202)) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); else tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.6e+189) || ~((z <= 3.9e+202))) tmp = (z * (1.0 - log(t))) + x; else tmp = x + (y + ((a + -0.5) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.6e+189], N[Not[LessEqual[z, 3.9e+202]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+189} \lor \neg \left(z \leq 3.9 \cdot 10^{+202}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\end{array}
\end{array}
if z < -1.6e189 or 3.89999999999999983e202 < z Initial 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.7%
metadata-eval99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 79.9%
if -1.6e189 < z < 3.89999999999999983e202Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 87.9%
distribute-rgt-out87.9%
Simplified87.9%
Final simplification86.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -6.3e+184)
(+ t_1 (* a b))
(if (<= z 4.8e+202) (+ x (+ y (* (+ a -0.5) b))) (+ t_1 x)))))
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 <= -6.3e+184) {
tmp = t_1 + (a * b);
} else if (z <= 4.8e+202) {
tmp = x + (y + ((a + -0.5) * b));
} else {
tmp = t_1 + x;
}
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 = z * (1.0d0 - log(t))
if (z <= (-6.3d+184)) then
tmp = t_1 + (a * b)
else if (z <= 4.8d+202) then
tmp = x + (y + ((a + (-0.5d0)) * b))
else
tmp = t_1 + x
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 * (1.0 - Math.log(t));
double tmp;
if (z <= -6.3e+184) {
tmp = t_1 + (a * b);
} else if (z <= 4.8e+202) {
tmp = x + (y + ((a + -0.5) * b));
} else {
tmp = t_1 + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -6.3e+184: tmp = t_1 + (a * b) elif z <= 4.8e+202: tmp = x + (y + ((a + -0.5) * b)) else: tmp = t_1 + x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -6.3e+184) tmp = Float64(t_1 + Float64(a * b)); elseif (z <= 4.8e+202) tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); else tmp = Float64(t_1 + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (1.0 - log(t)); tmp = 0.0; if (z <= -6.3e+184) tmp = t_1 + (a * b); elseif (z <= 4.8e+202) tmp = x + (y + ((a + -0.5) * b)); else tmp = t_1 + x; end tmp_2 = 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, -6.3e+184], N[(t$95$1 + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e+202], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -6.3 \cdot 10^{+184}:\\
\;\;\;\;t\_1 + a \cdot b\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+202}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if z < -6.3e184Initial 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.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 86.1%
*-commutative86.1%
Simplified86.1%
if -6.3e184 < z < 4.8000000000000004e202Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 87.9%
distribute-rgt-out87.9%
Simplified87.9%
if 4.8000000000000004e202 < z Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
associate-+r+99.3%
+-commutative99.3%
*-lft-identity99.3%
metadata-eval99.3%
*-commutative99.3%
distribute-rgt-out--99.5%
metadata-eval99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 80.3%
Final simplification87.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.4e+211) (not (<= z 1e+203))) (* z (- 1.0 (log t))) (+ x (+ y (* (+ a -0.5) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.4e+211) || !(z <= 1e+203)) {
tmp = z * (1.0 - log(t));
} else {
tmp = x + (y + ((a + -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 ((z <= (-2.4d+211)) .or. (.not. (z <= 1d+203))) then
tmp = z * (1.0d0 - log(t))
else
tmp = x + (y + ((a + (-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 ((z <= -2.4e+211) || !(z <= 1e+203)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.4e+211) or not (z <= 1e+203): tmp = z * (1.0 - math.log(t)) else: tmp = x + (y + ((a + -0.5) * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.4e+211) || !(z <= 1e+203)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.4e+211) || ~((z <= 1e+203))) tmp = z * (1.0 - log(t)); else tmp = x + (y + ((a + -0.5) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.4e+211], N[Not[LessEqual[z, 1e+203]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+211} \lor \neg \left(z \leq 10^{+203}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\end{array}
\end{array}
if z < -2.40000000000000018e211 or 9.9999999999999999e202 < z Initial program 99.4%
Taylor expanded in a around 0 99.4%
Taylor expanded in z around inf 76.8%
if -2.40000000000000018e211 < z < 9.9999999999999999e202Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 86.6%
distribute-rgt-out86.6%
Simplified86.6%
Final simplification84.8%
(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 (or (<= a -6.5e+178)
(and (not (<= a -8e+88)) (or (<= a -5.2e+22) (not (<= a 3.4e+109)))))
(* a b)
(+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.5e+178) || (!(a <= -8e+88) && ((a <= -5.2e+22) || !(a <= 3.4e+109)))) {
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 <= (-6.5d+178)) .or. (.not. (a <= (-8d+88))) .and. (a <= (-5.2d+22)) .or. (.not. (a <= 3.4d+109))) 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 <= -6.5e+178) || (!(a <= -8e+88) && ((a <= -5.2e+22) || !(a <= 3.4e+109)))) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -6.5e+178) or (not (a <= -8e+88) and ((a <= -5.2e+22) or not (a <= 3.4e+109))): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6.5e+178) || (!(a <= -8e+88) && ((a <= -5.2e+22) || !(a <= 3.4e+109)))) 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 <= -6.5e+178) || (~((a <= -8e+88)) && ((a <= -5.2e+22) || ~((a <= 3.4e+109))))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6.5e+178], And[N[Not[LessEqual[a, -8e+88]], $MachinePrecision], Or[LessEqual[a, -5.2e+22], N[Not[LessEqual[a, 3.4e+109]], $MachinePrecision]]]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+178} \lor \neg \left(a \leq -8 \cdot 10^{+88}\right) \land \left(a \leq -5.2 \cdot 10^{+22} \lor \neg \left(a \leq 3.4 \cdot 10^{+109}\right)\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -6.5000000000000005e178 or -7.99999999999999968e88 < a < -5.2e22 or 3.40000000000000006e109 < a Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in a around inf 59.3%
*-commutative59.3%
Simplified59.3%
if -6.5000000000000005e178 < a < -7.99999999999999968e88 or -5.2e22 < a < 3.40000000000000006e109Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 74.6%
distribute-rgt-out74.6%
Simplified74.6%
Taylor expanded in b around 0 51.1%
+-commutative51.1%
Simplified51.1%
Final simplification53.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.15e+107)
x
(if (<= x 1.15e-218)
(* a b)
(if (<= x 1.4e-104) y (if (<= x 3.3e-57) (* -0.5 b) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.15e+107) {
tmp = x;
} else if (x <= 1.15e-218) {
tmp = a * b;
} else if (x <= 1.4e-104) {
tmp = y;
} else if (x <= 3.3e-57) {
tmp = -0.5 * 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.15d+107)) then
tmp = x
else if (x <= 1.15d-218) then
tmp = a * b
else if (x <= 1.4d-104) then
tmp = y
else if (x <= 3.3d-57) then
tmp = (-0.5d0) * 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.15e+107) {
tmp = x;
} else if (x <= 1.15e-218) {
tmp = a * b;
} else if (x <= 1.4e-104) {
tmp = y;
} else if (x <= 3.3e-57) {
tmp = -0.5 * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.15e+107: tmp = x elif x <= 1.15e-218: tmp = a * b elif x <= 1.4e-104: tmp = y elif x <= 3.3e-57: tmp = -0.5 * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.15e+107) tmp = x; elseif (x <= 1.15e-218) tmp = Float64(a * b); elseif (x <= 1.4e-104) tmp = y; elseif (x <= 3.3e-57) tmp = Float64(-0.5 * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.15e+107) tmp = x; elseif (x <= 1.15e-218) tmp = a * b; elseif (x <= 1.4e-104) tmp = y; elseif (x <= 3.3e-57) tmp = -0.5 * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.15e+107], x, If[LessEqual[x, 1.15e-218], N[(a * b), $MachinePrecision], If[LessEqual[x, 1.4e-104], y, If[LessEqual[x, 3.3e-57], N[(-0.5 * b), $MachinePrecision], y]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{+107}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-218}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-104}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-57}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.15e107Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in x around inf 60.0%
if -1.15e107 < x < 1.14999999999999997e-218Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in a around inf 32.4%
*-commutative32.4%
Simplified32.4%
if 1.14999999999999997e-218 < x < 1.4e-104 or 3.2999999999999998e-57 < x Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in y around inf 24.9%
if 1.4e-104 < x < 3.2999999999999998e-57Initial program 99.9%
Taylor expanded in y around 0 86.7%
associate-+r+86.7%
+-commutative86.7%
sub-neg86.7%
metadata-eval86.7%
+-commutative86.7%
Simplified86.7%
Taylor expanded in a around 0 48.0%
*-commutative48.0%
Simplified48.0%
Taylor expanded in b around inf 34.8%
*-commutative34.8%
Simplified34.8%
Final simplification35.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y 6.2e+87) (+ x (* b (- a 0.5))) (if (<= y 9.6e+205) (+ x (+ y (* -0.5 b))) (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6.2e+87) {
tmp = x + (b * (a - 0.5));
} else if (y <= 9.6e+205) {
tmp = x + (y + (-0.5 * b));
} 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 <= 6.2d+87) then
tmp = x + (b * (a - 0.5d0))
else if (y <= 9.6d+205) then
tmp = x + (y + ((-0.5d0) * b))
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 <= 6.2e+87) {
tmp = x + (b * (a - 0.5));
} else if (y <= 9.6e+205) {
tmp = x + (y + (-0.5 * b));
} else {
tmp = y + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 6.2e+87: tmp = x + (b * (a - 0.5)) elif y <= 9.6e+205: tmp = x + (y + (-0.5 * b)) else: tmp = y + (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 6.2e+87) tmp = Float64(x + Float64(b * Float64(a - 0.5))); elseif (y <= 9.6e+205) tmp = Float64(x + Float64(y + Float64(-0.5 * b))); 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 <= 6.2e+87) tmp = x + (b * (a - 0.5)); elseif (y <= 9.6e+205) tmp = x + (y + (-0.5 * b)); else tmp = y + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 6.2e+87], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.6e+205], N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{+87}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{+205}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\
\end{array}
\end{array}
if y < 6.1999999999999999e87Initial program 99.8%
Taylor expanded in y around 0 87.1%
associate-+r+87.2%
+-commutative87.2%
sub-neg87.2%
metadata-eval87.2%
+-commutative87.2%
Simplified87.2%
Taylor expanded in z around 0 60.3%
if 6.1999999999999999e87 < y < 9.59999999999999945e205Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 83.4%
distribute-rgt-out83.4%
Simplified83.4%
Taylor expanded in a around 0 73.5%
+-commutative73.5%
*-commutative73.5%
Simplified73.5%
if 9.59999999999999945e205 < y Initial program 99.9%
Taylor expanded in b around inf 62.9%
associate--l+62.9%
associate-/l*62.9%
Simplified62.9%
Taylor expanded in y around inf 56.2%
Taylor expanded in b around 0 73.4%
*-commutative73.4%
Simplified73.4%
Final simplification62.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.15e+136) (not (<= b 2e-19))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.15e+136) || !(b <= 2e-19)) {
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 <= (-1.15d+136)) .or. (.not. (b <= 2d-19))) 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 <= -1.15e+136) || !(b <= 2e-19)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.15e+136) or not (b <= 2e-19): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.15e+136) || !(b <= 2e-19)) 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 <= -1.15e+136) || ~((b <= 2e-19))) 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, -1.15e+136], N[Not[LessEqual[b, 2e-19]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.15 \cdot 10^{+136} \lor \neg \left(b \leq 2 \cdot 10^{-19}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -1.15e136 or 2e-19 < b Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in b around inf 69.9%
if -1.15e136 < b < 2e-19Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 64.8%
distribute-rgt-out64.8%
Simplified64.8%
Taylor expanded in b around 0 51.3%
+-commutative51.3%
Simplified51.3%
Final simplification58.5%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.55e-12) (+ x (* a b)) (if (<= x -4.3e-200) (* b (- a 0.5)) (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.55e-12) {
tmp = x + (a * b);
} else if (x <= -4.3e-200) {
tmp = 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 (x <= (-3.55d-12)) then
tmp = x + (a * b)
else if (x <= (-4.3d-200)) then
tmp = 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 (x <= -3.55e-12) {
tmp = x + (a * b);
} else if (x <= -4.3e-200) {
tmp = b * (a - 0.5);
} else {
tmp = y + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.55e-12: tmp = x + (a * b) elif x <= -4.3e-200: tmp = b * (a - 0.5) else: tmp = y + (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.55e-12) tmp = Float64(x + Float64(a * b)); elseif (x <= -4.3e-200) tmp = 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 (x <= -3.55e-12) tmp = x + (a * b); elseif (x <= -4.3e-200) tmp = b * (a - 0.5); else tmp = y + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.55e-12], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.3e-200], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.55 \cdot 10^{-12}:\\
\;\;\;\;x + a \cdot b\\
\mathbf{elif}\;x \leq -4.3 \cdot 10^{-200}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\
\end{array}
\end{array}
if x < -3.55e-12Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 80.8%
distribute-rgt-out80.8%
Simplified80.8%
Taylor expanded in a around inf 63.3%
*-commutative63.3%
Simplified63.3%
if -3.55e-12 < x < -4.29999999999999975e-200Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in b around inf 43.2%
if -4.29999999999999975e-200 < x Initial program 99.8%
Taylor expanded in b around inf 74.2%
associate--l+74.2%
associate-/l*74.2%
Simplified74.2%
Taylor expanded in y around inf 42.9%
Taylor expanded in b around 0 49.1%
*-commutative49.1%
Simplified49.1%
Final simplification52.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2.65e-92) (+ x (* a b)) (if (<= y 1.2e+88) (* b (- a 0.5)) (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.65e-92) {
tmp = x + (a * b);
} else if (y <= 1.2e+88) {
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 (y <= 2.65d-92) then
tmp = x + (a * b)
else if (y <= 1.2d+88) 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 (y <= 2.65e-92) {
tmp = x + (a * b);
} else if (y <= 1.2e+88) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.65e-92: tmp = x + (a * b) elif y <= 1.2e+88: tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.65e-92) tmp = Float64(x + Float64(a * b)); elseif (y <= 1.2e+88) 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 (y <= 2.65e-92) tmp = x + (a * b); elseif (y <= 1.2e+88) tmp = b * (a - 0.5); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.65e-92], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+88], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.65 \cdot 10^{-92}:\\
\;\;\;\;x + a \cdot b\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+88}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < 2.65000000000000015e-92Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 71.5%
distribute-rgt-out71.5%
Simplified71.5%
Taylor expanded in a around inf 48.6%
*-commutative48.6%
Simplified48.6%
if 2.65000000000000015e-92 < y < 1.2e88Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in b around inf 53.4%
if 1.2e88 < y Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 83.1%
distribute-rgt-out83.1%
Simplified83.1%
Taylor expanded in b around 0 62.1%
+-commutative62.1%
Simplified62.1%
Final simplification51.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.2e-12) x (if (<= x -3.8e-200) (* -0.5 b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.2e-12) {
tmp = x;
} else if (x <= -3.8e-200) {
tmp = -0.5 * 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 <= (-2.2d-12)) then
tmp = x
else if (x <= (-3.8d-200)) then
tmp = (-0.5d0) * 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 <= -2.2e-12) {
tmp = x;
} else if (x <= -3.8e-200) {
tmp = -0.5 * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.2e-12: tmp = x elif x <= -3.8e-200: tmp = -0.5 * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.2e-12) tmp = x; elseif (x <= -3.8e-200) tmp = Float64(-0.5 * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.2e-12) tmp = x; elseif (x <= -3.8e-200) tmp = -0.5 * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.2e-12], x, If[LessEqual[x, -3.8e-200], N[(-0.5 * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-12}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-200}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -2.19999999999999992e-12Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in x around inf 44.4%
if -2.19999999999999992e-12 < x < -3.8e-200Initial program 99.8%
Taylor expanded in y around 0 83.1%
associate-+r+83.1%
+-commutative83.1%
sub-neg83.1%
metadata-eval83.1%
+-commutative83.1%
Simplified83.1%
Taylor expanded in a around 0 53.0%
*-commutative53.0%
Simplified53.0%
Taylor expanded in b around inf 16.2%
*-commutative16.2%
Simplified16.2%
if -3.8e-200 < x Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in y around inf 22.1%
Final simplification27.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.65e+95) (+ 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 <= 1.65e+95) {
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 <= 1.65d+95) 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 <= 1.65e+95) {
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 <= 1.65e+95: 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 <= 1.65e+95) 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 <= 1.65e+95) 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, 1.65e+95], 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 1.65 \cdot 10^{+95}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\
\end{array}
\end{array}
if y < 1.6499999999999999e95Initial program 99.8%
Taylor expanded in y around 0 86.9%
associate-+r+86.9%
+-commutative86.9%
sub-neg86.9%
metadata-eval86.9%
+-commutative86.9%
Simplified86.9%
Taylor expanded in z around 0 60.4%
if 1.6499999999999999e95 < y Initial program 99.9%
Taylor expanded in b around inf 62.6%
associate--l+62.6%
associate-/l*62.7%
Simplified62.7%
Taylor expanded in y around inf 41.7%
Taylor expanded in b around 0 55.4%
*-commutative55.4%
Simplified55.4%
Final simplification59.5%
(FPCore (x y z t a b) :precision binary64 (+ x (+ y (* (+ a -0.5) b))))
double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((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 + ((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 + ((a + -0.5) * b));
}
def code(x, y, z, t, a, b): return x + (y + ((a + -0.5) * b))
function code(x, y, z, t, a, b) return Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))) end
function tmp = code(x, y, z, t, a, b) tmp = x + (y + ((a + -0.5) * b)); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + \left(a + -0.5\right) \cdot b\right)
\end{array}
Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 74.7%
distribute-rgt-out74.7%
Simplified74.7%
Final simplification74.7%
(FPCore (x y z t a b) :precision binary64 (if (<= x -2.8e+46) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -2.8e+46) {
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 <= (-2.8d+46)) 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 <= -2.8e+46) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -2.8e+46: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -2.8e+46) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -2.8e+46) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.8e+46], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+46}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -2.80000000000000018e46Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in x around inf 50.7%
if -2.80000000000000018e46 < x Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in y around inf 21.4%
(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%
Taylor expanded in a around 0 99.8%
Taylor expanded in x around inf 22.1%
(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 2024085
(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)))