
(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 (+ (* z (- 1.0 (log t))) (fma (+ a -0.5) b (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (z * (1.0 - log(t))) + fma((a + -0.5), b, (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z * Float64(1.0 - log(t))) + fma(Float64(a + -0.5), b, Float64(x + y))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -1e+132) (not (<= t_1 2e+114)))
(+ (+ x y) t_1)
(+ x (+ (* z (- 1.0 (log t))) 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+132) || !(t_1 <= 2e+114)) {
tmp = (x + y) + t_1;
} else {
tmp = x + ((z * (1.0 - log(t))) + 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+132)) .or. (.not. (t_1 <= 2d+114))) then
tmp = (x + y) + t_1
else
tmp = x + ((z * (1.0d0 - log(t))) + 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+132) || !(t_1 <= 2e+114)) {
tmp = (x + y) + t_1;
} else {
tmp = x + ((z * (1.0 - Math.log(t))) + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -1e+132) or not (t_1 <= 2e+114): tmp = (x + y) + t_1 else: tmp = x + ((z * (1.0 - math.log(t))) + 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+132) || !(t_1 <= 2e+114)) tmp = Float64(Float64(x + y) + t_1); else tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + 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+132) || ~((t_1 <= 2e+114))) tmp = (x + y) + t_1; else tmp = x + ((z * (1.0 - log(t))) + 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+132], N[Not[LessEqual[t$95$1, 2e+114]], $MachinePrecision]], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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^{+132} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+114}\right):\\
\;\;\;\;\left(x + y\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -9.99999999999999991e131 or 2e114 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in z around 0 94.1%
if -9.99999999999999991e131 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2e114Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 91.5%
Final simplification92.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (+ t_1 (- z (* z (log t))))))
(if (<= z -3.2e+191)
t_2
(if (<= z 1.04e+117)
(+ (+ x y) t_1)
(if (<= z 1e+213) (+ x (+ (* z (- 1.0 (log t))) y)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = t_1 + (z - (z * log(t)));
double tmp;
if (z <= -3.2e+191) {
tmp = t_2;
} else if (z <= 1.04e+117) {
tmp = (x + y) + t_1;
} else if (z <= 1e+213) {
tmp = x + ((z * (1.0 - log(t))) + y);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = b * (a - 0.5d0)
t_2 = t_1 + (z - (z * log(t)))
if (z <= (-3.2d+191)) then
tmp = t_2
else if (z <= 1.04d+117) then
tmp = (x + y) + t_1
else if (z <= 1d+213) then
tmp = x + ((z * (1.0d0 - log(t))) + y)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = t_1 + (z - (z * Math.log(t)));
double tmp;
if (z <= -3.2e+191) {
tmp = t_2;
} else if (z <= 1.04e+117) {
tmp = (x + y) + t_1;
} else if (z <= 1e+213) {
tmp = x + ((z * (1.0 - Math.log(t))) + y);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = t_1 + (z - (z * math.log(t))) tmp = 0 if z <= -3.2e+191: tmp = t_2 elif z <= 1.04e+117: tmp = (x + y) + t_1 elif z <= 1e+213: tmp = x + ((z * (1.0 - math.log(t))) + y) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(t_1 + Float64(z - Float64(z * log(t)))) tmp = 0.0 if (z <= -3.2e+191) tmp = t_2; elseif (z <= 1.04e+117) tmp = Float64(Float64(x + y) + t_1); elseif (z <= 1e+213) tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); t_2 = t_1 + (z - (z * log(t))); tmp = 0.0; if (z <= -3.2e+191) tmp = t_2; elseif (z <= 1.04e+117) tmp = (x + y) + t_1; elseif (z <= 1e+213) tmp = x + ((z * (1.0 - log(t))) + y); else tmp = t_2; 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[(t$95$1 + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+191], t$95$2, If[LessEqual[z, 1.04e+117], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 1e+213], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := t\_1 + \left(z - z \cdot \log t\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+191}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.04 \cdot 10^{+117}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\mathbf{elif}\;z \leq 10^{+213}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -3.2000000000000002e191 or 9.99999999999999984e212 < z Initial program 99.6%
Taylor expanded in y around 0 95.9%
Taylor expanded in x around 0 92.0%
if -3.2000000000000002e191 < z < 1.03999999999999995e117Initial program 100.0%
Taylor expanded in z around 0 96.4%
if 1.03999999999999995e117 < z < 9.99999999999999984e212Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 84.3%
Final simplification94.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= z -2e+136) (not (<= z 1.06e+57)))
(+ t_1 (- (+ z x) (* 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 ((z <= -2e+136) || !(z <= 1.06e+57)) {
tmp = t_1 + ((z + x) - (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 ((z <= (-2d+136)) .or. (.not. (z <= 1.06d+57))) then
tmp = t_1 + ((z + x) - (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 ((z <= -2e+136) || !(z <= 1.06e+57)) {
tmp = t_1 + ((z + x) - (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 (z <= -2e+136) or not (z <= 1.06e+57): tmp = t_1 + ((z + x) - (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 ((z <= -2e+136) || !(z <= 1.06e+57)) tmp = Float64(t_1 + Float64(Float64(z + x) - 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 ((z <= -2e+136) || ~((z <= 1.06e+57))) tmp = t_1 + ((z + x) - (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[Or[LessEqual[z, -2e+136], N[Not[LessEqual[z, 1.06e+57]], $MachinePrecision]], N[(t$95$1 + N[(N[(z + x), $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 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+136} \lor \neg \left(z \leq 1.06 \cdot 10^{+57}\right):\\
\;\;\;\;t\_1 + \left(\left(z + x\right) - z \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\end{array}
\end{array}
if z < -2.00000000000000012e136 or 1.06e57 < z Initial program 99.7%
Taylor expanded in y around 0 86.9%
if -2.00000000000000012e136 < z < 1.06e57Initial program 100.0%
Taylor expanded in z around 0 98.9%
Final simplification94.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.25e+195) (not (<= z 4.6e+117))) (+ (* z (- 1.0 (log t))) x) (+ (+ x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.25e+195) || !(z <= 4.6e+117)) {
tmp = (z * (1.0 - log(t))) + x;
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.25d+195)) .or. (.not. (z <= 4.6d+117))) then
tmp = (z * (1.0d0 - log(t))) + x
else
tmp = (x + y) + (b * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.25e+195) || !(z <= 4.6e+117)) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else {
tmp = (x + y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.25e+195) or not (z <= 4.6e+117): tmp = (z * (1.0 - math.log(t))) + x else: tmp = (x + y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.25e+195) || !(z <= 4.6e+117)) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); else tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.25e+195) || ~((z <= 4.6e+117))) tmp = (z * (1.0 - log(t))) + x; else tmp = (x + y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.25e+195], N[Not[LessEqual[z, 4.6e+117]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+195} \lor \neg \left(z \leq 4.6 \cdot 10^{+117}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -1.2499999999999999e195 or 4.59999999999999976e117 < z Initial program 99.6%
Taylor expanded in y around 0 89.0%
Taylor expanded in b around 0 68.7%
Taylor expanded in z around 0 68.7%
if -1.2499999999999999e195 < z < 4.59999999999999976e117Initial program 100.0%
Taylor expanded in z around 0 95.9%
Final simplification88.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -8.3e+195) (+ (* z (- 1.0 (log t))) x) (if (<= z 4.2e+117) (+ (+ x y) (* b (- a 0.5))) (- (+ z x) (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8.3e+195) {
tmp = (z * (1.0 - log(t))) + x;
} else if (z <= 4.2e+117) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = (z + x) - (z * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-8.3d+195)) then
tmp = (z * (1.0d0 - log(t))) + x
else if (z <= 4.2d+117) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = (z + x) - (z * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8.3e+195) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else if (z <= 4.2e+117) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = (z + x) - (z * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -8.3e+195: tmp = (z * (1.0 - math.log(t))) + x elif z <= 4.2e+117: tmp = (x + y) + (b * (a - 0.5)) else: tmp = (z + x) - (z * math.log(t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -8.3e+195) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); elseif (z <= 4.2e+117) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(Float64(z + x) - Float64(z * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -8.3e+195) tmp = (z * (1.0 - log(t))) + x; elseif (z <= 4.2e+117) tmp = (x + y) + (b * (a - 0.5)); else tmp = (z + x) - (z * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8.3e+195], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 4.2e+117], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + x), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.3 \cdot 10^{+195}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+117}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + x\right) - z \cdot \log t\\
\end{array}
\end{array}
if z < -8.29999999999999972e195Initial program 99.6%
Taylor expanded in y around 0 94.6%
Taylor expanded in b around 0 80.6%
Taylor expanded in z around 0 80.8%
if -8.29999999999999972e195 < z < 4.2000000000000002e117Initial program 100.0%
Taylor expanded in z around 0 95.9%
if 4.2000000000000002e117 < z Initial program 99.7%
Taylor expanded in y around 0 86.7%
Taylor expanded in b around 0 63.7%
Final simplification88.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -9.8e+195) (not (<= z 9.8e+188))) (* 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 <= -9.8e+195) || !(z <= 9.8e+188)) {
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 <= (-9.8d+195)) .or. (.not. (z <= 9.8d+188))) 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 <= -9.8e+195) || !(z <= 9.8e+188)) {
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 <= -9.8e+195) or not (z <= 9.8e+188): 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 <= -9.8e+195) || !(z <= 9.8e+188)) 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 <= -9.8e+195) || ~((z <= 9.8e+188))) 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, -9.8e+195], N[Not[LessEqual[z, 9.8e+188]], $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 -9.8 \cdot 10^{+195} \lor \neg \left(z \leq 9.8 \cdot 10^{+188}\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 < -9.80000000000000027e195 or 9.8e188 < z Initial program 99.5%
Taylor expanded in y around 0 94.3%
Taylor expanded in b around 0 73.4%
Taylor expanded in z around inf 73.5%
Taylor expanded in z around inf 69.8%
if -9.80000000000000027e195 < z < 9.8e188Initial program 100.0%
Taylor expanded in z around 0 92.0%
Final simplification87.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.65e+195) (* z (- 1.0 (log t))) (if (<= z 1e+186) (+ (+ x y) (* b (- a 0.5))) (- z (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.65e+195) {
tmp = z * (1.0 - log(t));
} else if (z <= 1e+186) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = z - (z * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.65d+195)) then
tmp = z * (1.0d0 - log(t))
else if (z <= 1d+186) then
tmp = (x + y) + (b * (a - 0.5d0))
else
tmp = z - (z * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.65e+195) {
tmp = z * (1.0 - Math.log(t));
} else if (z <= 1e+186) {
tmp = (x + y) + (b * (a - 0.5));
} else {
tmp = z - (z * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.65e+195: tmp = z * (1.0 - math.log(t)) elif z <= 1e+186: tmp = (x + y) + (b * (a - 0.5)) else: tmp = z - (z * math.log(t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.65e+195) tmp = Float64(z * Float64(1.0 - log(t))); elseif (z <= 1e+186) tmp = Float64(Float64(x + y) + Float64(b * Float64(a - 0.5))); else tmp = Float64(z - Float64(z * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.65e+195) tmp = z * (1.0 - log(t)); elseif (z <= 1e+186) tmp = (x + y) + (b * (a - 0.5)); else tmp = z - (z * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.65e+195], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+186], N[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+195}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{elif}\;z \leq 10^{+186}:\\
\;\;\;\;\left(x + y\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;z - z \cdot \log t\\
\end{array}
\end{array}
if z < -1.65e195Initial program 99.6%
Taylor expanded in y around 0 94.6%
Taylor expanded in b around 0 80.6%
Taylor expanded in z around inf 80.8%
Taylor expanded in z around inf 76.1%
if -1.65e195 < z < 9.9999999999999998e185Initial program 100.0%
Taylor expanded in z around 0 92.0%
if 9.9999999999999998e185 < z Initial program 99.5%
Taylor expanded in y around 0 94.1%
Taylor expanded in b around 0 68.1%
Taylor expanded in x around 0 65.2%
Final simplification87.9%
(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
(let* ((t_1 (+ y (* -0.5 b))) (t_2 (* b (- a 0.5))))
(if (<= b -3e+35)
t_2
(if (<= b -1.85e-109)
t_1
(if (<= b 1.32e-247)
x
(if (<= b 0.0017) t_1 (if (<= b 8.8e+15) x t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (-0.5 * b);
double t_2 = b * (a - 0.5);
double tmp;
if (b <= -3e+35) {
tmp = t_2;
} else if (b <= -1.85e-109) {
tmp = t_1;
} else if (b <= 1.32e-247) {
tmp = x;
} else if (b <= 0.0017) {
tmp = t_1;
} else if (b <= 8.8e+15) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y + ((-0.5d0) * b)
t_2 = b * (a - 0.5d0)
if (b <= (-3d+35)) then
tmp = t_2
else if (b <= (-1.85d-109)) then
tmp = t_1
else if (b <= 1.32d-247) then
tmp = x
else if (b <= 0.0017d0) then
tmp = t_1
else if (b <= 8.8d+15) then
tmp = x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (-0.5 * b);
double t_2 = b * (a - 0.5);
double tmp;
if (b <= -3e+35) {
tmp = t_2;
} else if (b <= -1.85e-109) {
tmp = t_1;
} else if (b <= 1.32e-247) {
tmp = x;
} else if (b <= 0.0017) {
tmp = t_1;
} else if (b <= 8.8e+15) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (-0.5 * b) t_2 = b * (a - 0.5) tmp = 0 if b <= -3e+35: tmp = t_2 elif b <= -1.85e-109: tmp = t_1 elif b <= 1.32e-247: tmp = x elif b <= 0.0017: tmp = t_1 elif b <= 8.8e+15: tmp = x else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(-0.5 * b)) t_2 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (b <= -3e+35) tmp = t_2; elseif (b <= -1.85e-109) tmp = t_1; elseif (b <= 1.32e-247) tmp = x; elseif (b <= 0.0017) tmp = t_1; elseif (b <= 8.8e+15) tmp = x; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (-0.5 * b); t_2 = b * (a - 0.5); tmp = 0.0; if (b <= -3e+35) tmp = t_2; elseif (b <= -1.85e-109) tmp = t_1; elseif (b <= 1.32e-247) tmp = x; elseif (b <= 0.0017) tmp = t_1; elseif (b <= 8.8e+15) tmp = x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3e+35], t$95$2, If[LessEqual[b, -1.85e-109], t$95$1, If[LessEqual[b, 1.32e-247], x, If[LessEqual[b, 0.0017], t$95$1, If[LessEqual[b, 8.8e+15], x, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + -0.5 \cdot b\\
t_2 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;b \leq -3 \cdot 10^{+35}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -1.85 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.32 \cdot 10^{-247}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 0.0017:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 8.8 \cdot 10^{+15}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -2.99999999999999991e35 or 8.8e15 < b Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 71.7%
if -2.99999999999999991e35 < b < -1.8499999999999999e-109 or 1.3200000000000001e-247 < b < 0.00169999999999999991Initial program 99.9%
Taylor expanded in z around -inf 83.1%
associate-*r*83.1%
neg-mul-183.1%
mul-1-neg83.1%
neg-mul-183.1%
sub-neg83.1%
Simplified83.1%
Taylor expanded in y around inf 44.8%
Taylor expanded in a around 0 37.0%
*-commutative37.0%
Simplified37.0%
if -1.8499999999999999e-109 < b < 1.3200000000000001e-247 or 0.00169999999999999991 < b < 8.8e15Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 31.1%
Final simplification50.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= b -2.85e+35)
t_1
(if (<= b -4.7e-110)
y
(if (<= b 1.3e-247)
x
(if (<= b 1.05e-107) y (if (<= b 31500000000000.0) x 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 (b <= -2.85e+35) {
tmp = t_1;
} else if (b <= -4.7e-110) {
tmp = y;
} else if (b <= 1.3e-247) {
tmp = x;
} else if (b <= 1.05e-107) {
tmp = y;
} else if (b <= 31500000000000.0) {
tmp = x;
} else {
tmp = 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 (b <= (-2.85d+35)) then
tmp = t_1
else if (b <= (-4.7d-110)) then
tmp = y
else if (b <= 1.3d-247) then
tmp = x
else if (b <= 1.05d-107) then
tmp = y
else if (b <= 31500000000000.0d0) then
tmp = x
else
tmp = 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 (b <= -2.85e+35) {
tmp = t_1;
} else if (b <= -4.7e-110) {
tmp = y;
} else if (b <= 1.3e-247) {
tmp = x;
} else if (b <= 1.05e-107) {
tmp = y;
} else if (b <= 31500000000000.0) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if b <= -2.85e+35: tmp = t_1 elif b <= -4.7e-110: tmp = y elif b <= 1.3e-247: tmp = x elif b <= 1.05e-107: tmp = y elif b <= 31500000000000.0: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (b <= -2.85e+35) tmp = t_1; elseif (b <= -4.7e-110) tmp = y; elseif (b <= 1.3e-247) tmp = x; elseif (b <= 1.05e-107) tmp = y; elseif (b <= 31500000000000.0) tmp = x; else tmp = 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 (b <= -2.85e+35) tmp = t_1; elseif (b <= -4.7e-110) tmp = y; elseif (b <= 1.3e-247) tmp = x; elseif (b <= 1.05e-107) tmp = y; elseif (b <= 31500000000000.0) tmp = x; else tmp = 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[b, -2.85e+35], t$95$1, If[LessEqual[b, -4.7e-110], y, If[LessEqual[b, 1.3e-247], x, If[LessEqual[b, 1.05e-107], y, If[LessEqual[b, 31500000000000.0], x, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;b \leq -2.85 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -4.7 \cdot 10^{-110}:\\
\;\;\;\;y\\
\mathbf{elif}\;b \leq 1.3 \cdot 10^{-247}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{-107}:\\
\;\;\;\;y\\
\mathbf{elif}\;b \leq 31500000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.84999999999999997e35 or 3.15e13 < b Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 71.7%
if -2.84999999999999997e35 < b < -4.69999999999999992e-110 or 1.3e-247 < b < 1.05e-107Initial program 99.9%
+-commutative99.9%
associate--l+100.0%
associate-+r+100.0%
+-commutative100.0%
*-lft-identity100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 36.5%
if -4.69999999999999992e-110 < b < 1.3e-247 or 1.05e-107 < b < 3.15e13Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 36.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -9.8e+76)
(* a b)
(if (<= a -8e-217)
y
(if (<= a 7.8e-156)
x
(if (<= a 8.6e-28) (* -0.5 b) (if (<= a 4e+48) x (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -9.8e+76) {
tmp = a * b;
} else if (a <= -8e-217) {
tmp = y;
} else if (a <= 7.8e-156) {
tmp = x;
} else if (a <= 8.6e-28) {
tmp = -0.5 * b;
} else if (a <= 4e+48) {
tmp = x;
} 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 (a <= (-9.8d+76)) then
tmp = a * b
else if (a <= (-8d-217)) then
tmp = y
else if (a <= 7.8d-156) then
tmp = x
else if (a <= 8.6d-28) then
tmp = (-0.5d0) * b
else if (a <= 4d+48) then
tmp = x
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 (a <= -9.8e+76) {
tmp = a * b;
} else if (a <= -8e-217) {
tmp = y;
} else if (a <= 7.8e-156) {
tmp = x;
} else if (a <= 8.6e-28) {
tmp = -0.5 * b;
} else if (a <= 4e+48) {
tmp = x;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -9.8e+76: tmp = a * b elif a <= -8e-217: tmp = y elif a <= 7.8e-156: tmp = x elif a <= 8.6e-28: tmp = -0.5 * b elif a <= 4e+48: tmp = x else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -9.8e+76) tmp = Float64(a * b); elseif (a <= -8e-217) tmp = y; elseif (a <= 7.8e-156) tmp = x; elseif (a <= 8.6e-28) tmp = Float64(-0.5 * b); elseif (a <= 4e+48) tmp = x; else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -9.8e+76) tmp = a * b; elseif (a <= -8e-217) tmp = y; elseif (a <= 7.8e-156) tmp = x; elseif (a <= 8.6e-28) tmp = -0.5 * b; elseif (a <= 4e+48) tmp = x; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -9.8e+76], N[(a * b), $MachinePrecision], If[LessEqual[a, -8e-217], y, If[LessEqual[a, 7.8e-156], x, If[LessEqual[a, 8.6e-28], N[(-0.5 * b), $MachinePrecision], If[LessEqual[a, 4e+48], x, N[(a * b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.8 \cdot 10^{+76}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \leq -8 \cdot 10^{-217}:\\
\;\;\;\;y\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{-156}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 8.6 \cdot 10^{-28}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;a \leq 4 \cdot 10^{+48}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if a < -9.80000000000000053e76 or 4.00000000000000018e48 < a Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 53.8%
*-commutative53.8%
Simplified53.8%
if -9.80000000000000053e76 < a < -8.00000000000000066e-217Initial program 99.8%
+-commutative99.8%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 33.0%
if -8.00000000000000066e-217 < a < 7.8000000000000002e-156 or 8.6e-28 < a < 4.00000000000000018e48Initial program 99.8%
+-commutative99.8%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 26.6%
if 7.8000000000000002e-156 < a < 8.6e-28Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 36.4%
Taylor expanded in a around 0 36.4%
Final simplification40.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) 5e-192) (+ 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) <= 5e-192) {
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) <= 5d-192) 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) <= 5e-192) {
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) <= 5e-192: 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) <= 5e-192) 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) <= 5e-192) 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], 5e-192], 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 5 \cdot 10^{-192}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < 5.0000000000000001e-192Initial program 99.9%
Taylor expanded in z around -inf 84.4%
associate-*r*84.4%
neg-mul-184.4%
mul-1-neg84.4%
neg-mul-184.4%
sub-neg84.4%
Simplified84.4%
Taylor expanded in x around inf 57.5%
if 5.0000000000000001e-192 < (+.f64 x y) Initial program 99.9%
Taylor expanded in z around -inf 85.2%
associate-*r*85.2%
neg-mul-185.2%
mul-1-neg85.2%
neg-mul-185.2%
sub-neg85.2%
Simplified85.2%
Taylor expanded in y around inf 63.8%
Final simplification60.4%
(FPCore (x y z t a b) :precision binary64 (if (<= y 4.9e+78) (+ 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.9e+78) {
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.9d+78) 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.9e+78) {
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.9e+78: 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.9e+78) 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.9e+78) 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.9e+78], 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.9 \cdot 10^{+78}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\end{array}
if y < 4.9000000000000002e78Initial program 99.9%
Taylor expanded in z around -inf 86.5%
associate-*r*86.5%
neg-mul-186.5%
mul-1-neg86.5%
neg-mul-186.5%
sub-neg86.5%
Simplified86.5%
Taylor expanded in x around inf 63.7%
if 4.9000000000000002e78 < y Initial program 99.8%
Taylor expanded in z around -inf 77.9%
associate-*r*77.9%
neg-mul-177.9%
mul-1-neg77.9%
neg-mul-177.9%
sub-neg77.9%
Simplified77.9%
Taylor expanded in y around inf 75.6%
Taylor expanded in a around 0 58.7%
*-commutative58.7%
Simplified58.7%
Final simplification62.7%
(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%
Taylor expanded in z around 0 80.2%
Final simplification80.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y 62000000000000.0) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 62000000000000.0) {
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 <= 62000000000000.0d0) 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 <= 62000000000000.0) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 62000000000000.0: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 62000000000000.0) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 62000000000000.0) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 62000000000000.0], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 62000000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 6.2e13Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 26.4%
if 6.2e13 < y Initial program 99.8%
+-commutative99.8%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 46.6%
(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-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 22.5%
(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 2024103
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))