
(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 (log (/ E t))) (fma (+ a -0.5) b (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (z * log((((double) M_E) / t))) + fma((a + -0.5), b, (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z * log(Float64(exp(1) / t))) + fma(Float64(a + -0.5), b, Float64(x + y))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z * N[Log[N[(E / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \log \left(\frac{e}{t}\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
add-log-exp99.9%
exp-diff99.9%
add-exp-log99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (+ (fma (+ a -0.5) b (+ x y)) (* z (- 1.0 (log t)))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((a + -0.5), b, (x + y)) + (z * (1.0 - log(t)));
}
function code(x, y, z, t, a, b) return Float64(fma(Float64(a + -0.5), b, Float64(x + y)) + Float64(z * Float64(1.0 - log(t)))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, b, x + y\right) + z \cdot \left(1 - \log t\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (* z (- 1.0 (log t)))))
(if (<= z -1.7e+168)
(+ (+ x y) t_2)
(if (<= z 6.6e+162) (+ (+ x y) t_1) (+ 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 <= -1.7e+168) {
tmp = (x + y) + t_2;
} else if (z <= 6.6e+162) {
tmp = (x + y) + t_1;
} 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 <= (-1.7d+168)) then
tmp = (x + y) + t_2
else if (z <= 6.6d+162) then
tmp = (x + y) + t_1
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 <= -1.7e+168) {
tmp = (x + y) + t_2;
} else if (z <= 6.6e+162) {
tmp = (x + y) + t_1;
} 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 <= -1.7e+168: tmp = (x + y) + t_2 elif z <= 6.6e+162: tmp = (x + y) + t_1 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 <= -1.7e+168) tmp = Float64(Float64(x + y) + t_2); elseif (z <= 6.6e+162) tmp = Float64(Float64(x + y) + t_1); 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 <= -1.7e+168) tmp = (x + y) + t_2; elseif (z <= 6.6e+162) tmp = (x + y) + t_1; 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, -1.7e+168], N[(N[(x + y), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[z, 6.6e+162], N[(N[(x + y), $MachinePrecision] + t$95$1), $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 -1.7 \cdot 10^{+168}:\\
\;\;\;\;\left(x + y\right) + t\_2\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{+162}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2 + t\_1\\
\end{array}
\end{array}
if z < -1.70000000000000001e168Initial program 99.7%
+-commutative99.7%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 86.2%
if -1.70000000000000001e168 < z < 6.59999999999999975e162Initial program 100.0%
add-cbrt-cube42.5%
pow342.5%
associate--l+42.5%
associate-+l+42.5%
*-commutative42.5%
*-un-lft-identity42.5%
distribute-rgt-out--42.5%
Applied egg-rr42.5%
Taylor expanded in z around 0 94.5%
if 6.59999999999999975e162 < z Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 99.9%
Final simplification94.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) 1e+121) (- (+ x (+ z t_1)) (* z (log t))) (+ (+ 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 ((x + y) <= 1e+121) {
tmp = (x + (z + t_1)) - (z * log(t));
} 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 ((x + y) <= 1d+121) then
tmp = (x + (z + t_1)) - (z * log(t))
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 ((x + y) <= 1e+121) {
tmp = (x + (z + t_1)) - (z * Math.log(t));
} 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 (x + y) <= 1e+121: tmp = (x + (z + t_1)) - (z * math.log(t)) 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 (Float64(x + y) <= 1e+121) tmp = Float64(Float64(x + Float64(z + t_1)) - Float64(z * log(t))); 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 ((x + y) <= 1e+121) tmp = (x + (z + t_1)) - (z * log(t)); 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[N[(x + y), $MachinePrecision], 1e+121], N[(N[(x + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $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}\;x + y \leq 10^{+121}:\\
\;\;\;\;\left(x + \left(z + t\_1\right)\right) - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < 1.00000000000000004e121Initial program 99.9%
Taylor expanded in y around 0 85.5%
if 1.00000000000000004e121 < (+.f64 x y) Initial program 99.9%
add-cbrt-cube9.5%
pow39.5%
associate--l+9.5%
associate-+l+9.5%
*-commutative9.5%
*-un-lft-identity9.5%
distribute-rgt-out--9.5%
Applied egg-rr9.5%
Taylor expanded in z around 0 90.4%
Final simplification86.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))))
(if (<= (+ x y) -1e-199)
(- (+ x (+ z (* b (- a 0.5)))) t_1)
(- (+ (+ z y) (* (+ a -0.5) b)) 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) <= -1e-199) {
tmp = (x + (z + (b * (a - 0.5)))) - t_1;
} else {
tmp = ((z + y) + ((a + -0.5) * b)) - 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) <= (-1d-199)) then
tmp = (x + (z + (b * (a - 0.5d0)))) - t_1
else
tmp = ((z + y) + ((a + (-0.5d0)) * b)) - 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) <= -1e-199) {
tmp = (x + (z + (b * (a - 0.5)))) - t_1;
} else {
tmp = ((z + y) + ((a + -0.5) * b)) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) tmp = 0 if (x + y) <= -1e-199: tmp = (x + (z + (b * (a - 0.5)))) - t_1 else: tmp = ((z + y) + ((a + -0.5) * b)) - 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) <= -1e-199) tmp = Float64(Float64(x + Float64(z + Float64(b * Float64(a - 0.5)))) - t_1); else tmp = Float64(Float64(Float64(z + y) + Float64(Float64(a + -0.5) * b)) - 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) <= -1e-199) tmp = (x + (z + (b * (a - 0.5)))) - t_1; else tmp = ((z + y) + ((a + -0.5) * b)) - 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], -1e-199], N[(N[(x + N[(z + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(z + y), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
\mathbf{if}\;x + y \leq -1 \cdot 10^{-199}:\\
\;\;\;\;\left(x + \left(z + b \cdot \left(a - 0.5\right)\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\left(z + y\right) + \left(a + -0.5\right) \cdot b\right) - t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < -9.99999999999999982e-200Initial program 99.9%
Taylor expanded in y around 0 80.8%
if -9.99999999999999982e-200 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around 0 78.8%
associate-+r+78.8%
+-commutative78.8%
sub-neg78.8%
metadata-eval78.8%
+-commutative78.8%
Simplified78.8%
Final simplification79.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -3e+168)
(+ (* z (log (/ E t))) y)
(if (<= z 5.5e+173)
(+ (+ x y) (* b (- a 0.5)))
(+ (* z (- 1.0 (log t))) (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3e+168) {
tmp = (z * log((((double) M_E) / t))) + y;
} else if (z <= 5.5e+173) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = (z * (1.0 - log(t))) + (-0.5 * b);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3e+168) {
tmp = (z * Math.log((Math.E / t))) + y;
} else if (z <= 5.5e+173) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = (z * (1.0 - Math.log(t))) + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3e+168: tmp = (z * math.log((math.e / t))) + y elif z <= 5.5e+173: tmp = (x + y) + (b * (a - 0.5)) else: tmp = (z * (1.0 - math.log(t))) + (-0.5 * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3e+168) tmp = Float64(Float64(z * log(Float64(exp(1) / t))) + y); elseif (z <= 5.5e+173) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(-0.5 * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3e+168) tmp = (z * log((2.71828182845904523536 / t))) + y; elseif (z <= 5.5e+173) tmp = (x + y) + (b * (a - 0.5)); else tmp = (z * (1.0 - log(t))) + (-0.5 * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3e+168], N[(N[(z * N[Log[N[(E / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[z, 5.5e+173], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+168}:\\
\;\;\;\;z \cdot \log \left(\frac{e}{t}\right) + y\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+173}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + -0.5 \cdot b\\
\end{array}
\end{array}
if z < -2.9999999999999998e168Initial program 99.7%
+-commutative99.7%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
add-log-exp99.8%
exp-diff99.8%
add-exp-log99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 70.0%
expm1-log1p-u70.0%
expm1-udef50.3%
exp-1-e50.3%
Applied egg-rr50.3%
expm1-def70.0%
expm1-log1p70.0%
Simplified70.0%
if -2.9999999999999998e168 < z < 5.50000000000000049e173Initial program 100.0%
add-cbrt-cube42.2%
pow342.2%
associate--l+42.2%
associate-+l+42.2%
*-commutative42.2%
*-un-lft-identity42.2%
distribute-rgt-out--42.2%
Applied egg-rr42.2%
Taylor expanded in z around 0 93.6%
if 5.50000000000000049e173 < z Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around inf 99.8%
Taylor expanded in a around 0 86.1%
*-commutative8.7%
Simplified86.1%
Final simplification89.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.25e+170)
(+ (* z (log (/ E t))) y)
(if (<= z 7e+164)
(+ (+ x y) (* b (- a 0.5)))
(+ (* z (- 1.0 (log t))) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.25e+170) {
tmp = (z * log((((double) M_E) / t))) + y;
} else if (z <= 7e+164) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = (z * (1.0 - log(t))) + (a * b);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.25e+170) {
tmp = (z * Math.log((Math.E / t))) + y;
} else if (z <= 7e+164) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = (z * (1.0 - Math.log(t))) + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.25e+170: tmp = (z * math.log((math.e / t))) + y elif z <= 7e+164: tmp = (x + y) + (b * (a - 0.5)) else: tmp = (z * (1.0 - math.log(t))) + (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.25e+170) tmp = Float64(Float64(z * log(Float64(exp(1) / t))) + y); elseif (z <= 7e+164) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.25e+170) tmp = (z * log((2.71828182845904523536 / t))) + y; elseif (z <= 7e+164) tmp = (x + y) + (b * (a - 0.5)); else tmp = (z * (1.0 - log(t))) + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.25e+170], N[(N[(z * N[Log[N[(E / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[z, 7e+164], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+170}:\\
\;\;\;\;z \cdot \log \left(\frac{e}{t}\right) + y\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+164}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + a \cdot b\\
\end{array}
\end{array}
if z < -2.25000000000000011e170Initial program 99.7%
+-commutative99.7%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
add-log-exp99.8%
exp-diff99.8%
add-exp-log99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 70.0%
expm1-log1p-u70.0%
expm1-udef50.3%
exp-1-e50.3%
Applied egg-rr50.3%
expm1-def70.0%
expm1-log1p70.0%
Simplified70.0%
if -2.25000000000000011e170 < z < 6.9999999999999995e164Initial program 100.0%
add-cbrt-cube42.5%
pow342.5%
associate--l+42.5%
associate-+l+42.5%
*-commutative42.5%
*-un-lft-identity42.5%
distribute-rgt-out--42.5%
Applied egg-rr42.5%
Taylor expanded in z around 0 94.5%
if 6.9999999999999995e164 < z Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 93.6%
*-commutative93.6%
Simplified93.6%
Final simplification91.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -7e+169)
(+ (+ x y) t_1)
(if (<= z 6.2e+167) (+ (+ x y) (* b (- a 0.5))) (+ t_1 (* a b))))))
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 <= -7e+169) {
tmp = (x + y) + t_1;
} else if (z <= 6.2e+167) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = t_1 + (a * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z * (1.0d0 - log(t))
if (z <= (-7d+169)) then
tmp = (x + y) + t_1
else if (z <= 6.2d+167) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = t_1 + (a * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - Math.log(t));
double tmp;
if (z <= -7e+169) {
tmp = (x + y) + t_1;
} else if (z <= 6.2e+167) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = t_1 + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -7e+169: tmp = (x + y) + t_1 elif z <= 6.2e+167: tmp = (x + y) + (b * (a - 0.5)) else: tmp = t_1 + (a * b) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -7e+169) tmp = Float64(Float64(x + y) + t_1); elseif (z <= 6.2e+167) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(t_1 + Float64(a * b)); 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 <= -7e+169) tmp = (x + y) + t_1; elseif (z <= 6.2e+167) tmp = (x + y) + (b * (a - 0.5)); else tmp = t_1 + (a * b); 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, -7e+169], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 6.2e+167], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(a * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -7 \cdot 10^{+169}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+167}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + a \cdot b\\
\end{array}
\end{array}
if z < -7.00000000000000038e169Initial program 99.7%
+-commutative99.7%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 86.2%
if -7.00000000000000038e169 < z < 6.1999999999999999e167Initial program 100.0%
add-cbrt-cube42.5%
pow342.5%
associate--l+42.5%
associate-+l+42.5%
*-commutative42.5%
*-un-lft-identity42.5%
distribute-rgt-out--42.5%
Applied egg-rr42.5%
Taylor expanded in z around 0 94.5%
if 6.1999999999999999e167 < z Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 93.6%
*-commutative93.6%
Simplified93.6%
Final simplification93.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.1e+240) (not (<= z 7.2e+175))) (* 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 <= -5.1e+240) || !(z <= 7.2e+175)) {
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 <= (-5.1d+240)) .or. (.not. (z <= 7.2d+175))) 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 <= -5.1e+240) || !(z <= 7.2e+175)) {
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 <= -5.1e+240) or not (z <= 7.2e+175): 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 <= -5.1e+240) || !(z <= 7.2e+175)) 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 <= -5.1e+240) || ~((z <= 7.2e+175))) 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, -5.1e+240], N[Not[LessEqual[z, 7.2e+175]], $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 -5.1 \cdot 10^{+240} \lor \neg \left(z \leq 7.2 \cdot 10^{+175}\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 < -5.09999999999999976e240 or 7.20000000000000067e175 < z Initial program 99.7%
+-commutative99.7%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in z around inf 79.4%
if -5.09999999999999976e240 < z < 7.20000000000000067e175Initial program 100.0%
add-cbrt-cube39.3%
pow339.3%
associate--l+39.3%
associate-+l+39.3%
*-commutative39.3%
*-un-lft-identity39.3%
distribute-rgt-out--39.3%
Applied egg-rr39.3%
Taylor expanded in z around 0 90.3%
Final simplification88.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -2.7e+169) (+ (* z (log (/ E t))) y) (if (<= z 1.25e+176) (+ (+ x y) (* b (- a 0.5))) (* z (- 1.0 (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.7e+169) {
tmp = (z * log((((double) M_E) / t))) + y;
} else if (z <= 1.25e+176) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = z * (1.0 - log(t));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.7e+169) {
tmp = (z * Math.log((Math.E / t))) + y;
} else if (z <= 1.25e+176) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = z * (1.0 - Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.7e+169: tmp = (z * math.log((math.e / t))) + y elif z <= 1.25e+176: tmp = (x + y) + (b * (a - 0.5)) else: tmp = z * (1.0 - math.log(t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.7e+169) tmp = Float64(Float64(z * log(Float64(exp(1) / t))) + y); elseif (z <= 1.25e+176) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(z * Float64(1.0 - log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.7e+169) tmp = (z * log((2.71828182845904523536 / t))) + y; elseif (z <= 1.25e+176) tmp = (x + y) + (b * (a - 0.5)); else tmp = z * (1.0 - log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.7e+169], N[(N[(z * N[Log[N[(E / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[z, 1.25e+176], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+169}:\\
\;\;\;\;z \cdot \log \left(\frac{e}{t}\right) + y\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+176}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if z < -2.69999999999999991e169Initial program 99.7%
+-commutative99.7%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
add-log-exp99.8%
exp-diff99.8%
add-exp-log99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 70.0%
expm1-log1p-u70.0%
expm1-udef50.3%
exp-1-e50.3%
Applied egg-rr50.3%
expm1-def70.0%
expm1-log1p70.0%
Simplified70.0%
if -2.69999999999999991e169 < z < 1.25e176Initial program 100.0%
add-cbrt-cube42.2%
pow342.2%
associate--l+42.2%
associate-+l+42.2%
*-commutative42.2%
*-un-lft-identity42.2%
distribute-rgt-out--42.2%
Applied egg-rr42.2%
Taylor expanded in z around 0 93.6%
if 1.25e176 < z Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in z around inf 79.0%
Final simplification89.0%
(FPCore (x y z t a b) :precision binary64 (+ (- (+ z (+ x y)) (* z (log t))) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * Math.log(t))) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return ((z + (x + y)) - (z * math.log(t))) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(z + Float64(x + y)) - Float64(z * log(t))) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= b -1.8e+32)
(not (or (<= b 1.45e+57) (and (not (<= b 1.4e+80)) (<= b 9e+106)))))
(* 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.8e+32) || !((b <= 1.45e+57) || (!(b <= 1.4e+80) && (b <= 9e+106)))) {
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.8d+32)) .or. (.not. (b <= 1.45d+57) .or. (.not. (b <= 1.4d+80)) .and. (b <= 9d+106))) 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.8e+32) || !((b <= 1.45e+57) || (!(b <= 1.4e+80) && (b <= 9e+106)))) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.8e+32) or not ((b <= 1.45e+57) or (not (b <= 1.4e+80) and (b <= 9e+106))): 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.8e+32) || !((b <= 1.45e+57) || (!(b <= 1.4e+80) && (b <= 9e+106)))) 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.8e+32) || ~(((b <= 1.45e+57) || (~((b <= 1.4e+80)) && (b <= 9e+106))))) 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.8e+32], N[Not[Or[LessEqual[b, 1.45e+57], And[N[Not[LessEqual[b, 1.4e+80]], $MachinePrecision], LessEqual[b, 9e+106]]]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{+32} \lor \neg \left(b \leq 1.45 \cdot 10^{+57} \lor \neg \left(b \leq 1.4 \cdot 10^{+80}\right) \land b \leq 9 \cdot 10^{+106}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -1.7999999999999998e32 or 1.4500000000000001e57 < b < 1.39999999999999992e80 or 8.9999999999999994e106 < b Initial program 100.0%
Taylor expanded in x around 0 89.9%
associate-+r+89.9%
+-commutative89.9%
sub-neg89.9%
metadata-eval89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in b around inf 78.2%
if -1.7999999999999998e32 < b < 1.4500000000000001e57 or 1.39999999999999992e80 < b < 8.9999999999999994e106Initial program 99.9%
add-cbrt-cube30.3%
pow330.3%
associate--l+30.3%
associate-+l+30.3%
*-commutative30.3%
*-un-lft-identity30.3%
distribute-rgt-out--30.3%
Applied egg-rr30.3%
Taylor expanded in z around 0 68.5%
Taylor expanded in b around 0 58.2%
+-commutative58.2%
Simplified58.2%
Final simplification66.1%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= b -4e+34)
(and (not (<= b 1.8e+57)) (or (<= b 2.9e+80) (not (<= b 1.7e+107)))))
(* a b)
(+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4e+34) || (!(b <= 1.8e+57) && ((b <= 2.9e+80) || !(b <= 1.7e+107)))) {
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 ((b <= (-4d+34)) .or. (.not. (b <= 1.8d+57)) .and. (b <= 2.9d+80) .or. (.not. (b <= 1.7d+107))) 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 ((b <= -4e+34) || (!(b <= 1.8e+57) && ((b <= 2.9e+80) || !(b <= 1.7e+107)))) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -4e+34) or (not (b <= 1.8e+57) and ((b <= 2.9e+80) or not (b <= 1.7e+107))): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4e+34) || (!(b <= 1.8e+57) && ((b <= 2.9e+80) || !(b <= 1.7e+107)))) 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 ((b <= -4e+34) || (~((b <= 1.8e+57)) && ((b <= 2.9e+80) || ~((b <= 1.7e+107))))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4e+34], And[N[Not[LessEqual[b, 1.8e+57]], $MachinePrecision], Or[LessEqual[b, 2.9e+80], N[Not[LessEqual[b, 1.7e+107]], $MachinePrecision]]]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+34} \lor \neg \left(b \leq 1.8 \cdot 10^{+57}\right) \land \left(b \leq 2.9 \cdot 10^{+80} \lor \neg \left(b \leq 1.7 \cdot 10^{+107}\right)\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -3.99999999999999978e34 or 1.8000000000000001e57 < b < 2.89999999999999986e80 or 1.6999999999999998e107 < b Initial program 100.0%
Taylor expanded in x around 0 89.9%
associate-+r+89.9%
+-commutative89.9%
sub-neg89.9%
metadata-eval89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in a around inf 53.2%
*-commutative53.2%
Simplified53.2%
if -3.99999999999999978e34 < b < 1.8000000000000001e57 or 2.89999999999999986e80 < b < 1.6999999999999998e107Initial program 99.9%
add-cbrt-cube30.3%
pow330.3%
associate--l+30.3%
associate-+l+30.3%
*-commutative30.3%
*-un-lft-identity30.3%
distribute-rgt-out--30.3%
Applied egg-rr30.3%
Taylor expanded in z around 0 68.5%
Taylor expanded in b around 0 58.2%
+-commutative58.2%
Simplified58.2%
Final simplification56.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y 7.5e-208) x (if (<= y 8e+131) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 7.5e-208) {
tmp = x;
} else if (y <= 8e+131) {
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 <= 7.5d-208) then
tmp = x
else if (y <= 8d+131) 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 <= 7.5e-208) {
tmp = x;
} else if (y <= 8e+131) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 7.5e-208: tmp = x elif y <= 8e+131: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 7.5e-208) tmp = x; elseif (y <= 8e+131) 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 <= 7.5e-208) tmp = x; elseif (y <= 8e+131) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 7.5e-208], x, If[LessEqual[y, 8e+131], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.5 \cdot 10^{-208}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+131}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 7.4999999999999999e-208Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 45.4%
Taylor expanded in z around 0 24.4%
if 7.4999999999999999e-208 < y < 7.9999999999999993e131Initial program 99.9%
Taylor expanded in x around 0 70.9%
associate-+r+70.9%
+-commutative70.9%
sub-neg70.9%
metadata-eval70.9%
+-commutative70.9%
Simplified70.9%
Taylor expanded in a around inf 23.4%
*-commutative23.4%
Simplified23.4%
if 7.9999999999999993e131 < y Initial program 99.9%
Taylor expanded in x around 0 92.8%
associate-+r+92.8%
+-commutative92.8%
sub-neg92.8%
metadata-eval92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in y around inf 58.1%
Final simplification28.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y 4.3e+107) (+ x (* b (- a 0.5))) (+ y (* -0.5 b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 4.3e+107) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 4.3d+107) then
tmp = x + (b * (a - 0.5d0))
else
tmp = y + ((-0.5d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 4.3e+107) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 4.3e+107: tmp = x + (b * (a - 0.5)) else: tmp = y + (-0.5 * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 4.3e+107) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = Float64(y + Float64(-0.5 * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 4.3e+107) tmp = x + (b * (a - 0.5)); else tmp = y + (-0.5 * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 4.3e+107], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.3 \cdot 10^{+107}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\end{array}
if y < 4.3e107Initial program 99.9%
add-cbrt-cube39.6%
pow339.6%
associate--l+39.6%
associate-+l+39.6%
*-commutative39.6%
*-un-lft-identity39.6%
distribute-rgt-out--39.6%
Applied egg-rr39.6%
Taylor expanded in z around 0 76.8%
Taylor expanded in y around 0 64.3%
if 4.3e107 < y Initial program 99.9%
Taylor expanded in x around 0 93.5%
associate-+r+93.5%
+-commutative93.5%
sub-neg93.5%
metadata-eval93.5%
+-commutative93.5%
Simplified93.5%
Taylor expanded in z around 0 79.2%
Taylor expanded in a around 0 59.7%
*-commutative59.7%
Simplified59.7%
Final simplification63.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= y 5.6e+61) (+ 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 <= 5.6e+61) {
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 <= 5.6d+61) 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 <= 5.6e+61) {
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 <= 5.6e+61: 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 <= 5.6e+61) 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 <= 5.6e+61) 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, 5.6e+61], 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 5.6 \cdot 10^{+61}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if y < 5.6000000000000003e61Initial program 99.9%
add-cbrt-cube39.8%
pow339.8%
associate--l+39.8%
associate-+l+39.8%
*-commutative39.8%
*-un-lft-identity39.8%
distribute-rgt-out--39.8%
Applied egg-rr39.8%
Taylor expanded in z around 0 78.3%
Taylor expanded in y around 0 65.9%
if 5.6000000000000003e61 < y Initial program 99.9%
Taylor expanded in x around 0 92.3%
associate-+r+92.3%
+-commutative92.3%
sub-neg92.3%
metadata-eval92.3%
+-commutative92.3%
Simplified92.3%
Taylor expanded in z around 0 69.8%
Final simplification66.6%
(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.9%
add-cbrt-cube35.0%
pow335.0%
associate--l+35.0%
associate-+l+35.0%
*-commutative35.0%
*-un-lft-identity35.0%
distribute-rgt-out--35.0%
Applied egg-rr35.0%
Taylor expanded in z around 0 78.1%
Final simplification78.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y 3e+53) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 3e+53) {
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 <= 3d+53) 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 <= 3e+53) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 3e+53: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 3e+53) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 3e+53) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 3e+53], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3 \cdot 10^{+53}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 2.99999999999999998e53Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 48.1%
Taylor expanded in z around 0 26.6%
if 2.99999999999999998e53 < y Initial program 99.9%
Taylor expanded in x around 0 92.5%
associate-+r+92.5%
+-commutative92.5%
sub-neg92.5%
metadata-eval92.5%
+-commutative92.5%
Simplified92.5%
Taylor expanded in y around inf 46.2%
Final simplification30.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.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 44.2%
Taylor expanded in z around 0 22.9%
Final simplification22.9%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + y) + (((1.0d0 - (log(t) ** 2.0d0)) * z) / (1.0d0 + log(t)))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - Math.pow(Math.log(t), 2.0)) * z) / (1.0 + Math.log(t)))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return ((x + y) + (((1.0 - math.pow(math.log(t), 2.0)) * z) / (1.0 + math.log(t)))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + y) + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t)))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + y) + (((1.0 - (log(t) ^ 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(N[(N[(1.0 - N[Power[N[Log[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] / N[(1.0 + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b
\end{array}
herbie shell --seed 2024027
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))