
(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 17 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 (+ x (fma z (- 1.0 (log t)) (fma (+ a -0.5) b y))))
double code(double x, double y, double z, double t, double a, double b) {
return x + fma(z, (1.0 - log(t)), fma((a + -0.5), b, y));
}
function code(x, y, z, t, a, b) return Float64(x + fma(z, Float64(1.0 - log(t)), fma(Float64(a + -0.5), b, y))) end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)
\end{array}
Initial program 99.5%
associate--l+99.5%
associate-+l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
+-commutative99.5%
*-commutative99.5%
cancel-sign-sub-inv99.5%
distribute-rgt1-in99.5%
*-commutative99.5%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (fma (+ a -0.5) b (- (+ y (+ x z)) (* z (log t)))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((a + -0.5), b, ((y + (x + z)) - (z * log(t))));
}
function code(x, y, z, t, a, b) return fma(Float64(a + -0.5), b, Float64(Float64(y + Float64(x + z)) - Float64(z * log(t)))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(a + -0.5), $MachinePrecision] * b + N[(N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, b, \left(y + \left(x + z\right)\right) - z \cdot \log t\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
associate-+l+99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -1e+94)
(+ (+ x y) (* (+ a -0.5) b))
(if (<= t_1 2e+51)
(+ (+ x y) (* 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) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -1e+94) {
tmp = (x + y) + ((a + -0.5) * b);
} else if (t_1 <= 2e+51) {
tmp = (x + y) + (z * (1.0 - log(t)));
} else {
tmp = fma((a + -0.5), b, (x + y));
}
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+94) tmp = Float64(Float64(x + y) + Float64(Float64(a + -0.5) * b)); elseif (t_1 <= 2e+51) tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 - log(t)))); else tmp = fma(Float64(a + -0.5), b, Float64(x + y)); 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+94], N[(N[(x + y), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+51], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+94}:\\
\;\;\;\;\left(x + y\right) + \left(a + -0.5\right) \cdot b\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+51}:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, b, x + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -1e94Initial program 98.3%
associate--l+98.3%
sub-neg98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in z around 0 88.2%
if -1e94 < (*.f64 (-.f64 a 1/2) b) < 2e51Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around 0 97.8%
if 2e51 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 87.6%
fma-def87.6%
sub-neg87.6%
metadata-eval87.6%
Simplified87.6%
Final simplification92.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (+ a -0.5) b))) (if (<= (+ x y) 4e+94) (+ t_1 (- (+ x z) (* z (log t)))) (+ (+ x y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + -0.5) * b;
double tmp;
if ((x + y) <= 4e+94) {
tmp = t_1 + ((x + z) - (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 = (a + (-0.5d0)) * b
if ((x + y) <= 4d+94) then
tmp = t_1 + ((x + z) - (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 = (a + -0.5) * b;
double tmp;
if ((x + y) <= 4e+94) {
tmp = t_1 + ((x + z) - (z * Math.log(t)));
} else {
tmp = (x + y) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + -0.5) * b tmp = 0 if (x + y) <= 4e+94: tmp = t_1 + ((x + z) - (z * math.log(t))) else: tmp = (x + y) + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + -0.5) * b) tmp = 0.0 if (Float64(x + y) <= 4e+94) tmp = Float64(t_1 + Float64(Float64(x + z) - 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 = (a + -0.5) * b; tmp = 0.0; if ((x + y) <= 4e+94) tmp = t_1 + ((x + z) - (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[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], 4e+94], N[(t$95$1 + N[(N[(x + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
\mathbf{if}\;x + y \leq 4 \cdot 10^{+94}:\\
\;\;\;\;t_1 + \left(\left(x + z\right) - z \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t_1\\
\end{array}
\end{array}
if (+.f64 x y) < 4.0000000000000001e94Initial program 99.3%
associate--l+99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 81.8%
*-commutative81.8%
Simplified81.8%
if 4.0000000000000001e94 < (+.f64 x y) Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 90.7%
Final simplification84.4%
(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(x + y) + Float64(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[(x + y), $MachinePrecision] + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b
\end{array}
Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -5.8e+259)
t_1
(if (<= z 7e+181)
(+ (+ x y) (* (+ a -0.5) b))
(if (<= z 5e+305) 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 <= -5.8e+259) {
tmp = t_1;
} else if (z <= 7e+181) {
tmp = (x + y) + ((a + -0.5) * b);
} else if (z <= 5e+305) {
tmp = t_1;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z * (1.0d0 - log(t))
if (z <= (-5.8d+259)) then
tmp = t_1
else if (z <= 7d+181) then
tmp = (x + y) + ((a + (-0.5d0)) * b)
else if (z <= 5d+305) then
tmp = t_1
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - Math.log(t));
double tmp;
if (z <= -5.8e+259) {
tmp = t_1;
} else if (z <= 7e+181) {
tmp = (x + y) + ((a + -0.5) * b);
} else if (z <= 5e+305) {
tmp = t_1;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -5.8e+259: tmp = t_1 elif z <= 7e+181: tmp = (x + y) + ((a + -0.5) * b) elif z <= 5e+305: tmp = t_1 else: tmp = 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 <= -5.8e+259) tmp = t_1; elseif (z <= 7e+181) tmp = Float64(Float64(x + y) + Float64(Float64(a + -0.5) * b)); elseif (z <= 5e+305) tmp = t_1; else tmp = 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 <= -5.8e+259) tmp = t_1; elseif (z <= 7e+181) tmp = (x + y) + ((a + -0.5) * b); elseif (z <= 5e+305) tmp = t_1; else tmp = 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, -5.8e+259], t$95$1, If[LessEqual[z, 7e+181], N[(N[(x + y), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e+305], t$95$1, N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+259}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+181}:\\
\;\;\;\;\left(x + y\right) + \left(a + -0.5\right) \cdot b\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+305}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if z < -5.7999999999999999e259 or 7.00000000000000016e181 < z < 5.00000000000000009e305Initial program 99.4%
associate--l+99.4%
associate-+l+99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
+-commutative99.4%
*-commutative99.4%
cancel-sign-sub-inv99.4%
distribute-rgt1-in99.8%
*-commutative99.8%
fma-def99.8%
+-commutative99.8%
unsub-neg99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 88.2%
Taylor expanded in x around 0 75.3%
Taylor expanded in z around inf 67.3%
if -5.7999999999999999e259 < z < 7.00000000000000016e181Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 89.0%
if 5.00000000000000009e305 < z Initial program 0.0%
associate--l+0.0%
sub-neg0.0%
metadata-eval0.0%
Simplified0.0%
Taylor expanded in z around 0 100.0%
Taylor expanded in y around 0 100.0%
Taylor expanded in a around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification85.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.4e+227) (not (<= z 5.3e+181))) (+ x (* 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 <= -4.4e+227) || !(z <= 5.3e+181)) {
tmp = x + (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 <= (-4.4d+227)) .or. (.not. (z <= 5.3d+181))) then
tmp = x + (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 <= -4.4e+227) || !(z <= 5.3e+181)) {
tmp = x + (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 <= -4.4e+227) or not (z <= 5.3e+181): tmp = x + (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 <= -4.4e+227) || !(z <= 5.3e+181)) tmp = Float64(x + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(Float64(x + 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 <= -4.4e+227) || ~((z <= 5.3e+181))) tmp = x + (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, -4.4e+227], N[Not[LessEqual[z, 5.3e+181]], $MachinePrecision]], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+227} \lor \neg \left(z \leq 5.3 \cdot 10^{+181}\right):\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \left(a + -0.5\right) \cdot b\\
\end{array}
\end{array}
if z < -4.4000000000000004e227 or 5.2999999999999996e181 < z Initial program 97.2%
associate--l+97.2%
associate-+l+97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+r+97.2%
+-commutative97.2%
+-commutative97.2%
*-commutative97.2%
cancel-sign-sub-inv97.2%
distribute-rgt1-in97.5%
*-commutative97.5%
fma-def99.8%
+-commutative99.8%
unsub-neg99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 76.5%
if -4.4000000000000004e227 < z < 5.2999999999999996e181Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 89.3%
Final simplification87.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.5e+122) (not (<= z 4.1e+181))) (+ y (* 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.5e+122) || !(z <= 4.1e+181)) {
tmp = y + (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.5d+122)) .or. (.not. (z <= 4.1d+181))) then
tmp = y + (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.5e+122) || !(z <= 4.1e+181)) {
tmp = y + (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.5e+122) or not (z <= 4.1e+181): tmp = y + (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.5e+122) || !(z <= 4.1e+181)) tmp = Float64(y + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(Float64(x + 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.5e+122) || ~((z <= 4.1e+181))) tmp = y + (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.5e+122], N[Not[LessEqual[z, 4.1e+181]], $MachinePrecision]], N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+122} \lor \neg \left(z \leq 4.1 \cdot 10^{+181}\right):\\
\;\;\;\;y + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + \left(a + -0.5\right) \cdot b\\
\end{array}
\end{array}
if z < -2.49999999999999994e122 or 4.10000000000000018e181 < z Initial program 98.2%
associate--l+98.2%
associate-+l+98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+r+98.2%
+-commutative98.2%
+-commutative98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
distribute-rgt1-in98.4%
*-commutative98.4%
fma-def99.8%
+-commutative99.8%
unsub-neg99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 77.2%
Taylor expanded in x around 0 63.3%
if -2.49999999999999994e122 < z < 4.10000000000000018e181Initial program 100.0%
associate--l+100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 94.1%
Final simplification85.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.55e+122) (not (<= z 4.9e+181))) (+ y (* 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) {
double tmp;
if ((z <= -1.55e+122) || !(z <= 4.9e+181)) {
tmp = y + (z * (1.0 - log(t)));
} else {
tmp = fma((a + -0.5), b, (x + y));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.55e+122) || !(z <= 4.9e+181)) tmp = Float64(y + Float64(z * Float64(1.0 - log(t)))); else tmp = fma(Float64(a + -0.5), b, Float64(x + y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.55e+122], N[Not[LessEqual[z, 4.9e+181]], $MachinePrecision]], N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+122} \lor \neg \left(z \leq 4.9 \cdot 10^{+181}\right):\\
\;\;\;\;y + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, b, x + y\right)\\
\end{array}
\end{array}
if z < -1.54999999999999999e122 or 4.89999999999999981e181 < z Initial program 98.2%
associate--l+98.2%
associate-+l+98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+r+98.2%
+-commutative98.2%
+-commutative98.2%
*-commutative98.2%
cancel-sign-sub-inv98.2%
distribute-rgt1-in98.4%
*-commutative98.4%
fma-def99.8%
+-commutative99.8%
unsub-neg99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 77.2%
Taylor expanded in x around 0 63.3%
if -1.54999999999999999e122 < z < 4.89999999999999981e181Initial program 100.0%
associate--l+100.0%
associate-+l+100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
+-commutative100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
distribute-rgt1-in100.0%
*-commutative100.0%
fma-def100.0%
+-commutative100.0%
unsub-neg100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 94.1%
fma-def94.1%
sub-neg94.1%
metadata-eval94.1%
Simplified94.1%
Final simplification85.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (or (<= t_1 -1e+178) (not (<= t_1 2e+145))) t_1 (+ x y))))
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+178) || !(t_1 <= 2e+145)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-1d+178)) .or. (.not. (t_1 <= 2d+145))) then
tmp = t_1
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 t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -1e+178) || !(t_1 <= 2e+145)) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -1e+178) or not (t_1 <= 2e+145): tmp = t_1 else: tmp = x + y 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+178) || !(t_1 <= 2e+145)) tmp = t_1; else tmp = Float64(x + y); 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+178) || ~((t_1 <= 2e+145))) tmp = t_1; else tmp = x + y; 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[Or[LessEqual[t$95$1, -1e+178], N[Not[LessEqual[t$95$1, 2e+145]], $MachinePrecision]], t$95$1, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+178} \lor \neg \left(t_1 \leq 2 \cdot 10^{+145}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -1.0000000000000001e178 or 2e145 < (*.f64 (-.f64 a 1/2) b) Initial program 99.0%
associate--l+99.0%
sub-neg99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in z around 0 92.9%
Taylor expanded in y around 0 87.1%
Taylor expanded in b around inf 78.6%
if -1.0000000000000001e178 < (*.f64 (-.f64 a 1/2) b) < 2e145Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 62.0%
Final simplification68.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2e-183)
x
(if (<= y -5.9e-294)
(* a b)
(if (<= y 1.4e-279) x (if (<= y 1.45e+87) (* a b) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2e-183) {
tmp = x;
} else if (y <= -5.9e-294) {
tmp = a * b;
} else if (y <= 1.4e-279) {
tmp = x;
} else if (y <= 1.45e+87) {
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 <= (-2d-183)) then
tmp = x
else if (y <= (-5.9d-294)) then
tmp = a * b
else if (y <= 1.4d-279) then
tmp = x
else if (y <= 1.45d+87) 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 <= -2e-183) {
tmp = x;
} else if (y <= -5.9e-294) {
tmp = a * b;
} else if (y <= 1.4e-279) {
tmp = x;
} else if (y <= 1.45e+87) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2e-183: tmp = x elif y <= -5.9e-294: tmp = a * b elif y <= 1.4e-279: tmp = x elif y <= 1.45e+87: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2e-183) tmp = x; elseif (y <= -5.9e-294) tmp = Float64(a * b); elseif (y <= 1.4e-279) tmp = x; elseif (y <= 1.45e+87) 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 <= -2e-183) tmp = x; elseif (y <= -5.9e-294) tmp = a * b; elseif (y <= 1.4e-279) tmp = x; elseif (y <= 1.45e+87) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2e-183], x, If[LessEqual[y, -5.9e-294], N[(a * b), $MachinePrecision], If[LessEqual[y, 1.4e-279], x, If[LessEqual[y, 1.45e+87], N[(a * b), $MachinePrecision], y]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-183}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -5.9 \cdot 10^{-294}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-279}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+87}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -2.00000000000000001e-183 or -5.89999999999999994e-294 < y < 1.4e-279Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in100.0%
*-commutative100.0%
fma-def100.0%
+-commutative100.0%
unsub-neg100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf 28.4%
if -2.00000000000000001e-183 < y < -5.89999999999999994e-294 or 1.4e-279 < y < 1.4499999999999999e87Initial program 98.8%
associate--l+98.8%
sub-neg98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in z around 0 75.3%
Taylor expanded in y around 0 71.9%
Taylor expanded in a around inf 38.4%
*-commutative38.4%
Simplified38.4%
if 1.4499999999999999e87 < y Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 89.2%
Taylor expanded in y around inf 55.9%
Final simplification37.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) -2e-123) (+ 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 ((x + y) <= -2e-123) {
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 ((x + y) <= (-2d-123)) 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 ((x + y) <= -2e-123) {
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 (x + y) <= -2e-123: 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 (Float64(x + y) <= -2e-123) 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 ((x + y) <= -2e-123) 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[N[(x + y), $MachinePrecision], -2e-123], 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}\;x + y \leq -2 \cdot 10^{-123}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;y + t_1\\
\end{array}
\end{array}
if (+.f64 x y) < -2.0000000000000001e-123Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 57.3%
if -2.0000000000000001e-123 < (+.f64 x y) Initial program 99.2%
associate--l+99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in z around 0 79.2%
Taylor expanded in x around 0 59.1%
Final simplification58.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.05e+124) (+ x (* b (- a 0.5))) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.05e+124) {
tmp = x + (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 <= 1.05d+124) then
tmp = x + (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 <= 1.05e+124) {
tmp = x + (b * (a - 0.5));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.05e+124: tmp = x + (b * (a - 0.5)) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.05e+124) tmp = Float64(x + 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 <= 1.05e+124) tmp = x + (b * (a - 0.5)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.05e+124], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.05 \cdot 10^{+124}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < 1.05000000000000006e124Initial program 99.4%
associate--l+99.4%
associate-+l+99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
+-commutative99.4%
*-commutative99.4%
cancel-sign-sub-inv99.4%
distribute-rgt1-in99.5%
*-commutative99.5%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 63.3%
if 1.05000000000000006e124 < y Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 61.6%
Final simplification63.0%
(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(Float64(x + 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[(N[(x + y), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + \left(a + -0.5\right) \cdot b
\end{array}
Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 79.6%
Final simplification79.6%
(FPCore (x y z t a b) :precision binary64 (if (<= b -2.1e+92) (* a b) (if (<= b 6e+74) (+ x y) (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.1e+92) {
tmp = a * b;
} else if (b <= 6e+74) {
tmp = x + y;
} else {
tmp = a * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-2.1d+92)) then
tmp = a * b
else if (b <= 6d+74) then
tmp = x + y
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.1e+92) {
tmp = a * b;
} else if (b <= 6e+74) {
tmp = x + y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -2.1e+92: tmp = a * b elif b <= 6e+74: tmp = x + y else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.1e+92) tmp = Float64(a * b); elseif (b <= 6e+74) tmp = Float64(x + y); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -2.1e+92) tmp = a * b; elseif (b <= 6e+74) tmp = x + y; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.1e+92], N[(a * b), $MachinePrecision], If[LessEqual[b, 6e+74], N[(x + y), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.1 \cdot 10^{+92}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+74}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if b < -2.09999999999999986e92 or 6e74 < b Initial program 98.9%
associate--l+98.9%
sub-neg98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in z around 0 87.9%
Taylor expanded in y around 0 81.6%
Taylor expanded in a around inf 46.5%
*-commutative46.5%
Simplified46.5%
if -2.09999999999999986e92 < b < 6e74Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 59.7%
Final simplification54.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y 3.8e+66) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 3.8e+66) {
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 <= 3.8d+66) 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 <= 3.8e+66) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 3.8e+66: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 3.8e+66) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 3.8e+66) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 3.8e+66], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.8 \cdot 10^{+66}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 3.8000000000000002e66Initial program 99.4%
associate--l+99.4%
associate-+l+99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
+-commutative99.4%
*-commutative99.4%
cancel-sign-sub-inv99.4%
distribute-rgt1-in99.4%
*-commutative99.4%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 26.2%
if 3.8000000000000002e66 < y Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 89.2%
Taylor expanded in y around inf 55.9%
Final simplification31.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.5%
associate--l+99.5%
associate-+l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
+-commutative99.5%
*-commutative99.5%
cancel-sign-sub-inv99.5%
distribute-rgt1-in99.5%
*-commutative99.5%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 22.7%
Final simplification22.7%
(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 2023171
(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)))