
(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.5%
+-commutative99.5%
associate--l+99.4%
associate-+r+99.4%
+-commutative99.4%
*-lft-identity99.4%
metadata-eval99.4%
*-commutative99.4%
distribute-rgt-out--99.5%
metadata-eval99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -2.9e+71)
(not (or (<= z 1.75e+110) (and (not (<= z 1.8e+172)) (<= z 3e+241)))))
(+ (* z (- 1.0 (log t))) x)
(+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.9e+71) || !((z <= 1.75e+110) || (!(z <= 1.8e+172) && (z <= 3e+241)))) {
tmp = (z * (1.0 - log(t))) + x;
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2.9d+71)) .or. (.not. (z <= 1.75d+110) .or. (.not. (z <= 1.8d+172)) .and. (z <= 3d+241))) then
tmp = (z * (1.0d0 - log(t))) + x
else
tmp = (x + y) + (b * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.9e+71) || !((z <= 1.75e+110) || (!(z <= 1.8e+172) && (z <= 3e+241)))) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.9e+71) or not ((z <= 1.75e+110) or (not (z <= 1.8e+172) and (z <= 3e+241))): tmp = (z * (1.0 - math.log(t))) + x else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.9e+71) || !((z <= 1.75e+110) || (!(z <= 1.8e+172) && (z <= 3e+241)))) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); else tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.9e+71) || ~(((z <= 1.75e+110) || (~((z <= 1.8e+172)) && (z <= 3e+241))))) tmp = (z * (1.0 - log(t))) + x; else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.9e+71], N[Not[Or[LessEqual[z, 1.75e+110], And[N[Not[LessEqual[z, 1.8e+172]], $MachinePrecision], LessEqual[z, 3e+241]]]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+71} \lor \neg \left(z \leq 1.75 \cdot 10^{+110} \lor \neg \left(z \leq 1.8 \cdot 10^{+172}\right) \land z \leq 3 \cdot 10^{+241}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -2.90000000000000007e71 or 1.75e110 < z < 1.79999999999999987e172 or 3.00000000000000015e241 < z Initial program 98.3%
Taylor expanded in b around 0 82.4%
add-sqr-sqrt44.9%
pow244.9%
associate--l+44.9%
+-commutative44.9%
*-commutative44.9%
Applied egg-rr44.9%
Taylor expanded in y around 0 68.5%
associate--l+68.5%
*-commutative68.5%
cancel-sign-sub-inv68.5%
*-lft-identity68.5%
log-rec68.5%
distribute-rgt-in68.7%
log-rec68.7%
sub-neg68.7%
Simplified68.7%
if -2.90000000000000007e71 < z < 1.75e110 or 1.79999999999999987e172 < z < 3.00000000000000015e241Initial program 100.0%
Taylor expanded in z around 0 92.3%
Final simplification84.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ z y) (* z (log t)))))
(if (<= z -2.9e+181)
t_1
(if (<= z 4.6e+110)
(+ x (fma b (+ a -0.5) y))
(if (<= z 6.2e+171)
(+ (* z (- 1.0 (log t))) x)
(if (<= z 1e+189) (+ (+ x y) (* b (- a 0.5))) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z + y) - (z * log(t));
double tmp;
if (z <= -2.9e+181) {
tmp = t_1;
} else if (z <= 4.6e+110) {
tmp = x + fma(b, (a + -0.5), y);
} else if (z <= 6.2e+171) {
tmp = (z * (1.0 - log(t))) + x;
} else if (z <= 1e+189) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z + y) - Float64(z * log(t))) tmp = 0.0 if (z <= -2.9e+181) tmp = t_1; elseif (z <= 4.6e+110) tmp = Float64(x + fma(b, Float64(a + -0.5), y)); elseif (z <= 6.2e+171) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); elseif (z <= 1e+189) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z + y), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e+181], t$95$1, If[LessEqual[z, 4.6e+110], N[(x + N[(b * N[(a + -0.5), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e+171], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 1e+189], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + y\right) - z \cdot \log t\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{+181}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+110}:\\
\;\;\;\;x + \mathsf{fma}\left(b, a + -0.5, y\right)\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+171}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{elif}\;z \leq 10^{+189}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.9e181 or 1e189 < z Initial program 97.7%
Taylor expanded in b around 0 84.2%
Taylor expanded in x around 0 75.4%
+-commutative75.4%
*-commutative75.4%
Simplified75.4%
if -2.9e181 < z < 4.6e110Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 89.9%
+-commutative89.9%
sub-neg89.9%
metadata-eval89.9%
fma-define89.9%
Simplified89.9%
if 4.6e110 < z < 6.1999999999999998e171Initial program 99.6%
Taylor expanded in b around 0 93.4%
add-sqr-sqrt37.4%
pow237.4%
associate--l+37.4%
+-commutative37.4%
*-commutative37.4%
Applied egg-rr37.4%
Taylor expanded in y around 0 66.4%
associate--l+66.3%
*-commutative66.3%
cancel-sign-sub-inv66.3%
*-lft-identity66.3%
log-rec66.3%
distribute-rgt-in66.3%
log-rec66.3%
sub-neg66.3%
Simplified66.3%
if 6.1999999999999998e171 < z < 1e189Initial program 100.0%
Taylor expanded in z around 0 85.8%
Final simplification85.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -1e+207)
(+ x (fma b (+ a -0.5) y))
(if (<= t_1 1e+79) (+ x (+ (* z (- 1.0 (log t))) y)) (+ (+ x 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 (t_1 <= -1e+207) {
tmp = x + fma(b, (a + -0.5), y);
} else if (t_1 <= 1e+79) {
tmp = x + ((z * (1.0 - log(t))) + y);
} else {
tmp = (x + 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 (t_1 <= -1e+207) tmp = Float64(x + fma(b, Float64(a + -0.5), y)); elseif (t_1 <= 1e+79) tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y)); else tmp = Float64(Float64(x + y) + t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+207], N[(x + N[(b * N[(a + -0.5), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+79], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+207}:\\
\;\;\;\;x + \mathsf{fma}\left(b, a + -0.5, y\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+79}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -1e207Initial 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-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 91.5%
+-commutative91.5%
sub-neg91.5%
metadata-eval91.5%
fma-define91.5%
Simplified91.5%
if -1e207 < (*.f64 (-.f64 a 1/2) b) < 9.99999999999999967e78Initial 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 88.6%
if 9.99999999999999967e78 < (*.f64 (-.f64 a 1/2) b) Initial program 98.4%
Taylor expanded in z around 0 92.6%
Final simplification90.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -1e+52)
(+ t_1 (- z (* z (log t))))
(if (<= t_1 1e+79) (+ x (+ (* z (- 1.0 (log t))) y)) (+ (+ x 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 (t_1 <= -1e+52) {
tmp = t_1 + (z - (z * log(t)));
} else if (t_1 <= 1e+79) {
tmp = x + ((z * (1.0 - log(t))) + y);
} else {
tmp = (x + 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 (t_1 <= (-1d+52)) then
tmp = t_1 + (z - (z * log(t)))
else if (t_1 <= 1d+79) then
tmp = x + ((z * (1.0d0 - log(t))) + y)
else
tmp = (x + 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 (t_1 <= -1e+52) {
tmp = t_1 + (z - (z * Math.log(t)));
} else if (t_1 <= 1e+79) {
tmp = x + ((z * (1.0 - Math.log(t))) + y);
} else {
tmp = (x + y) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if t_1 <= -1e+52: tmp = t_1 + (z - (z * math.log(t))) elif t_1 <= 1e+79: tmp = x + ((z * (1.0 - math.log(t))) + y) else: tmp = (x + 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 (t_1 <= -1e+52) tmp = Float64(t_1 + Float64(z - Float64(z * log(t)))); elseif (t_1 <= 1e+79) tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y)); else tmp = Float64(Float64(x + 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 (t_1 <= -1e+52) tmp = t_1 + (z - (z * log(t))); elseif (t_1 <= 1e+79) tmp = x + ((z * (1.0 - log(t))) + y); else tmp = (x + 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[t$95$1, -1e+52], N[(t$95$1 + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+79], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+52}:\\
\;\;\;\;t\_1 + \left(z - z \cdot \log t\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+79}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -9.9999999999999999e51Initial program 99.9%
Taylor expanded in x around 0 94.5%
Taylor expanded in y around 0 89.5%
if -9.9999999999999999e51 < (*.f64 (-.f64 a 1/2) b) < 9.99999999999999967e78Initial 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 93.5%
if 9.99999999999999967e78 < (*.f64 (-.f64 a 1/2) b) Initial program 98.4%
Taylor expanded in z around 0 92.6%
Final simplification92.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= x -1.04e+167)
(+ (+ x y) t_1)
(if (<= x -4.5e+55)
(+ x (+ (* z (- 1.0 (log t))) y))
(+ t_1 (- (+ z y) (* z (log t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (x <= -1.04e+167) {
tmp = (x + y) + t_1;
} else if (x <= -4.5e+55) {
tmp = x + ((z * (1.0 - log(t))) + y);
} else {
tmp = t_1 + ((z + y) - (z * log(t)));
}
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 (x <= (-1.04d+167)) then
tmp = (x + y) + t_1
else if (x <= (-4.5d+55)) then
tmp = x + ((z * (1.0d0 - log(t))) + y)
else
tmp = t_1 + ((z + y) - (z * log(t)))
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 (x <= -1.04e+167) {
tmp = (x + y) + t_1;
} else if (x <= -4.5e+55) {
tmp = x + ((z * (1.0 - Math.log(t))) + y);
} else {
tmp = t_1 + ((z + y) - (z * Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if x <= -1.04e+167: tmp = (x + y) + t_1 elif x <= -4.5e+55: tmp = x + ((z * (1.0 - math.log(t))) + y) else: tmp = t_1 + ((z + y) - (z * math.log(t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (x <= -1.04e+167) tmp = Float64(Float64(x + y) + t_1); elseif (x <= -4.5e+55) tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y)); else tmp = Float64(t_1 + Float64(Float64(z + y) - Float64(z * log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if (x <= -1.04e+167) tmp = (x + y) + t_1; elseif (x <= -4.5e+55) tmp = x + ((z * (1.0 - log(t))) + y); else tmp = t_1 + ((z + y) - (z * log(t))); 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[x, -1.04e+167], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[x, -4.5e+55], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(z + y), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x \leq -1.04 \cdot 10^{+167}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{+55}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(z + y\right) - z \cdot \log t\right)\\
\end{array}
\end{array}
if x < -1.04e167Initial program 100.0%
Taylor expanded in z around 0 91.0%
if -1.04e167 < x < -4.49999999999999998e55Initial program 99.6%
+-commutative99.6%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around 0 86.4%
if -4.49999999999999998e55 < x Initial program 99.3%
Taylor expanded in x around 0 86.0%
Final simplification86.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.35e+191) (not (<= z 3.2e+241))) (* z (- 1.0 (log t))) (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.35e+191) || !(z <= 3.2e+241)) {
tmp = z * (1.0 - log(t));
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.35d+191)) .or. (.not. (z <= 3.2d+241))) then
tmp = z * (1.0d0 - log(t))
else
tmp = (x + y) + (b * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.35e+191) || !(z <= 3.2e+241)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.35e+191) or not (z <= 3.2e+241): tmp = z * (1.0 - math.log(t)) else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.35e+191) || !(z <= 3.2e+241)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.35e+191) || ~((z <= 3.2e+241))) tmp = z * (1.0 - log(t)); else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.35e+191], N[Not[LessEqual[z, 3.2e+241]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+191} \lor \neg \left(z \leq 3.2 \cdot 10^{+241}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -1.34999999999999998e191 or 3.20000000000000004e241 < z Initial program 97.2%
Taylor expanded in b around 0 83.6%
Taylor expanded in z around inf 76.3%
if -1.34999999999999998e191 < z < 3.20000000000000004e241Initial program 99.9%
Taylor expanded in z around 0 84.8%
Final simplification83.3%
(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.5%
Final simplification99.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.15e+102) (not (<= b 7.8e+94))) (* 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+102) || !(b <= 7.8e+94)) {
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+102)) .or. (.not. (b <= 7.8d+94))) 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+102) || !(b <= 7.8e+94)) {
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+102) or not (b <= 7.8e+94): 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+102) || !(b <= 7.8e+94)) 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+102) || ~((b <= 7.8e+94))) 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+102], N[Not[LessEqual[b, 7.8e+94]], $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^{+102} \lor \neg \left(b \leq 7.8 \cdot 10^{+94}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -1.1499999999999999e102 or 7.79999999999999971e94 < b Initial program 98.7%
+-commutative98.7%
associate--l+98.7%
associate-+r+98.7%
+-commutative98.7%
*-lft-identity98.7%
metadata-eval98.7%
*-commutative98.7%
distribute-rgt-out--98.7%
metadata-eval98.7%
fma-define98.7%
sub-neg98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in b around inf 68.7%
if -1.1499999999999999e102 < b < 7.79999999999999971e94Initial program 99.8%
Taylor expanded in z around 0 69.5%
Taylor expanded in b around 0 53.8%
+-commutative53.8%
Simplified53.8%
Final simplification58.7%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) 1e-107) (+ x (* (+ a -0.5) b)) (+ y (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 1e-107) {
tmp = x + ((a + -0.5) * b);
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x + y) <= 1d-107) then
tmp = x + ((a + (-0.5d0)) * b)
else
tmp = y + (b * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 1e-107) {
tmp = x + ((a + -0.5) * b);
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= 1e-107: tmp = x + ((a + -0.5) * b) else: tmp = y + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= 1e-107) tmp = Float64(x + Float64(Float64(a + -0.5) * b)); else tmp = Float64(y + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= 1e-107) tmp = x + ((a + -0.5) * b); else tmp = y + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], 1e-107], N[(x + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 10^{-107}:\\
\;\;\;\;x + \left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if (+.f64 x y) < 1e-107Initial program 99.8%
Taylor expanded in z around 0 72.2%
Taylor expanded in y around 0 52.3%
+-commutative52.3%
sub-neg52.3%
metadata-eval52.3%
Simplified52.3%
if 1e-107 < (+.f64 x y) Initial program 99.0%
Taylor expanded in z around 0 76.5%
Taylor expanded in x around 0 56.5%
Final simplification54.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -6.5e+97) (not (<= a 62.0))) (* a b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.5e+97) || !(a <= 62.0)) {
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+97)) .or. (.not. (a <= 62.0d0))) 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+97) || !(a <= 62.0)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -6.5e+97) or not (a <= 62.0): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6.5e+97) || !(a <= 62.0)) 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+97) || ~((a <= 62.0))) 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+97], N[Not[LessEqual[a, 62.0]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+97} \lor \neg \left(a \leq 62\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -6.4999999999999999e97 or 62 < a Initial program 99.0%
+-commutative99.0%
associate--l+99.0%
associate-+r+99.0%
+-commutative99.0%
*-lft-identity99.0%
metadata-eval99.0%
*-commutative99.0%
distribute-rgt-out--99.0%
metadata-eval99.0%
fma-define99.0%
sub-neg99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in a around inf 54.7%
*-commutative54.7%
Simplified54.7%
if -6.4999999999999999e97 < a < 62Initial program 99.8%
Taylor expanded in z around 0 69.8%
Taylor expanded in b around 0 51.7%
+-commutative51.7%
Simplified51.7%
Final simplification52.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3.4e-270) x (if (<= y 1.15e+106) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.4e-270) {
tmp = x;
} else if (y <= 1.15e+106) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= (-3.4d-270)) then
tmp = x
else if (y <= 1.15d+106) then
tmp = a * b
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3.4e-270) {
tmp = x;
} else if (y <= 1.15e+106) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -3.4e-270: tmp = x elif y <= 1.15e+106: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3.4e-270) tmp = x; elseif (y <= 1.15e+106) tmp = Float64(a * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -3.4e-270) tmp = x; elseif (y <= 1.15e+106) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.4e-270], x, If[LessEqual[y, 1.15e+106], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-270}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+106}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -3.4000000000000001e-270Initial 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 24.4%
if -3.4000000000000001e-270 < y < 1.1500000000000001e106Initial 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 36.1%
*-commutative36.1%
Simplified36.1%
if 1.1500000000000001e106 < y Initial program 97.5%
+-commutative97.5%
associate--l+97.5%
associate-+r+97.5%
+-commutative97.5%
*-lft-identity97.5%
metadata-eval97.5%
*-commutative97.5%
distribute-rgt-out--97.5%
metadata-eval97.5%
fma-define97.5%
sub-neg97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in y around inf 58.2%
Final simplification34.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -9.2e+55) (+ x y) (+ y (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9.2e+55) {
tmp = x + y;
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-9.2d+55)) then
tmp = x + y
else
tmp = y + (b * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9.2e+55) {
tmp = x + y;
} else {
tmp = y + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -9.2e+55: tmp = x + y else: tmp = y + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -9.2e+55) tmp = Float64(x + y); else tmp = Float64(y + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -9.2e+55) tmp = x + y; else tmp = y + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -9.2e+55], N[(x + y), $MachinePrecision], N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.2 \cdot 10^{+55}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if x < -9.1999999999999995e55Initial program 99.9%
Taylor expanded in z around 0 78.0%
Taylor expanded in b around 0 59.1%
+-commutative59.1%
Simplified59.1%
if -9.1999999999999995e55 < x Initial program 99.3%
Taylor expanded in z around 0 73.2%
Taylor expanded in x around 0 60.9%
Final simplification60.5%
(FPCore (x y z t a b) :precision binary64 (+ (+ x y) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (b * (a - 0.5));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x + y) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return (x + y) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + y) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.5%
Taylor expanded in z around 0 74.2%
Final simplification74.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.35e+36) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.35e+36) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 1.35d+36) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.35e+36) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.35e+36: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.35e+36) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.35e+36) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.35e+36], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.35 \cdot 10^{+36}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 1.35e36Initial 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 21.9%
if 1.35e36 < y Initial program 98.1%
+-commutative98.1%
associate--l+98.1%
associate-+r+98.1%
+-commutative98.1%
*-lft-identity98.1%
metadata-eval98.1%
*-commutative98.1%
distribute-rgt-out--98.1%
metadata-eval98.1%
fma-define98.1%
sub-neg98.1%
metadata-eval98.1%
Simplified98.1%
Taylor expanded in y around inf 48.6%
Final simplification27.7%
(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.5%
+-commutative99.5%
associate--l+99.4%
associate-+r+99.4%
+-commutative99.4%
*-lft-identity99.4%
metadata-eval99.4%
*-commutative99.4%
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 19.4%
Final simplification19.4%
(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 2024053
(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)))