
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (+ (* z (- 1.0 (log t))) (fma (+ a -0.5) b (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (z * (1.0 - log(t))) + fma((a + -0.5), b, (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z * Float64(1.0 - log(t))) + fma(Float64(a + -0.5), b, Float64(x + y))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)
\end{array}
Initial program 99.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%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -1.05e+142)
(not (or (<= z 6.2e+91) (and (not (<= z 8.8e+120)) (<= z 8.5e+179)))))
(+ (* z (- 1.0 (log t))) x)
(+ (* b (- a 0.5)) (+ x (+ z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.05e+142) || !((z <= 6.2e+91) || (!(z <= 8.8e+120) && (z <= 8.5e+179)))) {
tmp = (z * (1.0 - log(t))) + x;
} else {
tmp = (b * (a - 0.5)) + (x + (z + 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 ((z <= (-1.05d+142)) .or. (.not. (z <= 6.2d+91) .or. (.not. (z <= 8.8d+120)) .and. (z <= 8.5d+179))) then
tmp = (z * (1.0d0 - log(t))) + x
else
tmp = (b * (a - 0.5d0)) + (x + (z + 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 ((z <= -1.05e+142) || !((z <= 6.2e+91) || (!(z <= 8.8e+120) && (z <= 8.5e+179)))) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else {
tmp = (b * (a - 0.5)) + (x + (z + y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.05e+142) or not ((z <= 6.2e+91) or (not (z <= 8.8e+120) and (z <= 8.5e+179))): tmp = (z * (1.0 - math.log(t))) + x else: tmp = (b * (a - 0.5)) + (x + (z + y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.05e+142) || !((z <= 6.2e+91) || (!(z <= 8.8e+120) && (z <= 8.5e+179)))) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); else tmp = Float64(Float64(b * Float64(a - 0.5)) + Float64(x + Float64(z + y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.05e+142) || ~(((z <= 6.2e+91) || (~((z <= 8.8e+120)) && (z <= 8.5e+179))))) tmp = (z * (1.0 - log(t))) + x; else tmp = (b * (a - 0.5)) + (x + (z + y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.05e+142], N[Not[Or[LessEqual[z, 6.2e+91], And[N[Not[LessEqual[z, 8.8e+120]], $MachinePrecision], LessEqual[z, 8.5e+179]]]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + N[(z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+142} \lor \neg \left(z \leq 6.2 \cdot 10^{+91} \lor \neg \left(z \leq 8.8 \cdot 10^{+120}\right) \land z \leq 8.5 \cdot 10^{+179}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a - 0.5\right) + \left(x + \left(z + y\right)\right)\\
\end{array}
\end{array}
if z < -1.05e142 or 6.19999999999999995e91 < z < 8.8000000000000005e120 or 8.49999999999999962e179 < z Initial program 99.6%
+-commutative99.6%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 81.3%
associate-+r+81.3%
+-commutative81.3%
fma-define81.4%
Simplified81.4%
Taylor expanded in y around 0 76.5%
if -1.05e142 < z < 6.19999999999999995e91 or 8.8000000000000005e120 < z < 8.49999999999999962e179Initial program 99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 93.1%
+-commutative93.1%
+-commutative93.1%
Simplified93.1%
Final simplification88.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -1.22e+145)
(+ t_1 x)
(if (or (<= z 1.15e+94) (and (not (<= z 7e+123)) (<= z 8.6e+169)))
(+ (* b (- a 0.5)) (+ x (+ z y)))
(+ t_1 y)))))
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 <= -1.22e+145) {
tmp = t_1 + x;
} else if ((z <= 1.15e+94) || (!(z <= 7e+123) && (z <= 8.6e+169))) {
tmp = (b * (a - 0.5)) + (x + (z + y));
} else {
tmp = t_1 + 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 = z * (1.0d0 - log(t))
if (z <= (-1.22d+145)) then
tmp = t_1 + x
else if ((z <= 1.15d+94) .or. (.not. (z <= 7d+123)) .and. (z <= 8.6d+169)) then
tmp = (b * (a - 0.5d0)) + (x + (z + y))
else
tmp = t_1 + 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 = z * (1.0 - Math.log(t));
double tmp;
if (z <= -1.22e+145) {
tmp = t_1 + x;
} else if ((z <= 1.15e+94) || (!(z <= 7e+123) && (z <= 8.6e+169))) {
tmp = (b * (a - 0.5)) + (x + (z + y));
} else {
tmp = t_1 + y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -1.22e+145: tmp = t_1 + x elif (z <= 1.15e+94) or (not (z <= 7e+123) and (z <= 8.6e+169)): tmp = (b * (a - 0.5)) + (x + (z + y)) else: tmp = t_1 + y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -1.22e+145) tmp = Float64(t_1 + x); elseif ((z <= 1.15e+94) || (!(z <= 7e+123) && (z <= 8.6e+169))) tmp = Float64(Float64(b * Float64(a - 0.5)) + Float64(x + Float64(z + y))); else tmp = Float64(t_1 + y); 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 <= -1.22e+145) tmp = t_1 + x; elseif ((z <= 1.15e+94) || (~((z <= 7e+123)) && (z <= 8.6e+169))) tmp = (b * (a - 0.5)) + (x + (z + y)); else tmp = t_1 + y; 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, -1.22e+145], N[(t$95$1 + x), $MachinePrecision], If[Or[LessEqual[z, 1.15e+94], And[N[Not[LessEqual[z, 7e+123]], $MachinePrecision], LessEqual[z, 8.6e+169]]], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + N[(z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -1.22 \cdot 10^{+145}:\\
\;\;\;\;t\_1 + x\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{+94} \lor \neg \left(z \leq 7 \cdot 10^{+123}\right) \land z \leq 8.6 \cdot 10^{+169}:\\
\;\;\;\;b \cdot \left(a - 0.5\right) + \left(x + \left(z + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + y\\
\end{array}
\end{array}
if z < -1.21999999999999994e145Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
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 78.4%
associate-+r+78.4%
+-commutative78.4%
fma-define78.4%
Simplified78.4%
Taylor expanded in y around 0 71.3%
if -1.21999999999999994e145 < z < 1.15e94 or 6.99999999999999999e123 < z < 8.6000000000000003e169Initial program 99.9%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 93.5%
+-commutative93.5%
+-commutative93.5%
Simplified93.5%
if 1.15e94 < z < 6.99999999999999999e123 or 8.6000000000000003e169 < z Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in b around 0 84.8%
associate-+r+84.8%
+-commutative84.8%
fma-define84.8%
Simplified84.8%
Taylor expanded in x around 0 84.8%
Final simplification89.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* b (- a 0.5)) (+ x (+ z y))))
(t_2 (+ (* z (- 1.0 (log t))) x)))
(if (<= z -8.5e+144)
t_2
(if (<= z 1.65e+93)
t_1
(if (<= z 1e+121)
t_2
(if (<= z 8.4e+179) t_1 (+ x (- z (* z (log t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b * (a - 0.5)) + (x + (z + y));
double t_2 = (z * (1.0 - log(t))) + x;
double tmp;
if (z <= -8.5e+144) {
tmp = t_2;
} else if (z <= 1.65e+93) {
tmp = t_1;
} else if (z <= 1e+121) {
tmp = t_2;
} else if (z <= 8.4e+179) {
tmp = t_1;
} else {
tmp = x + (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * (a - 0.5d0)) + (x + (z + y))
t_2 = (z * (1.0d0 - log(t))) + x
if (z <= (-8.5d+144)) then
tmp = t_2
else if (z <= 1.65d+93) then
tmp = t_1
else if (z <= 1d+121) then
tmp = t_2
else if (z <= 8.4d+179) then
tmp = t_1
else
tmp = x + (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 t_1 = (b * (a - 0.5)) + (x + (z + y));
double t_2 = (z * (1.0 - Math.log(t))) + x;
double tmp;
if (z <= -8.5e+144) {
tmp = t_2;
} else if (z <= 1.65e+93) {
tmp = t_1;
} else if (z <= 1e+121) {
tmp = t_2;
} else if (z <= 8.4e+179) {
tmp = t_1;
} else {
tmp = x + (z - (z * Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b * (a - 0.5)) + (x + (z + y)) t_2 = (z * (1.0 - math.log(t))) + x tmp = 0 if z <= -8.5e+144: tmp = t_2 elif z <= 1.65e+93: tmp = t_1 elif z <= 1e+121: tmp = t_2 elif z <= 8.4e+179: tmp = t_1 else: tmp = x + (z - (z * math.log(t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b * Float64(a - 0.5)) + Float64(x + Float64(z + y))) t_2 = Float64(Float64(z * Float64(1.0 - log(t))) + x) tmp = 0.0 if (z <= -8.5e+144) tmp = t_2; elseif (z <= 1.65e+93) tmp = t_1; elseif (z <= 1e+121) tmp = t_2; elseif (z <= 8.4e+179) tmp = t_1; else tmp = Float64(x + Float64(z - Float64(z * log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b * (a - 0.5)) + (x + (z + y)); t_2 = (z * (1.0 - log(t))) + x; tmp = 0.0; if (z <= -8.5e+144) tmp = t_2; elseif (z <= 1.65e+93) tmp = t_1; elseif (z <= 1e+121) tmp = t_2; elseif (z <= 8.4e+179) tmp = t_1; else tmp = x + (z - (z * log(t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + N[(z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -8.5e+144], t$95$2, If[LessEqual[z, 1.65e+93], t$95$1, If[LessEqual[z, 1e+121], t$95$2, If[LessEqual[z, 8.4e+179], t$95$1, N[(x + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right) + \left(x + \left(z + y\right)\right)\\
t_2 := z \cdot \left(1 - \log t\right) + x\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+144}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 10^{+121}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 8.4 \cdot 10^{+179}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - z \cdot \log t\right)\\
\end{array}
\end{array}
if z < -8.4999999999999998e144 or 1.65000000000000004e93 < z < 1.00000000000000004e121Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
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 81.1%
associate-+r+81.1%
+-commutative81.1%
fma-define81.1%
Simplified81.1%
Taylor expanded in y around 0 74.0%
if -8.4999999999999998e144 < z < 1.65000000000000004e93 or 1.00000000000000004e121 < z < 8.3999999999999994e179Initial program 99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 93.1%
+-commutative93.1%
+-commutative93.1%
Simplified93.1%
if 8.3999999999999994e179 < z Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in b around 0 81.7%
associate-+r+81.7%
+-commutative81.7%
fma-define81.7%
Simplified81.7%
Taylor expanded in y around 0 79.5%
distribute-rgt-out--79.5%
*-un-lft-identity79.5%
*-commutative79.5%
Applied egg-rr79.5%
Final simplification88.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -2e+130)
(+ t_1 (+ x (+ z y)))
(if (<= t_1 5e+36) (+ x (+ (* z (- 1.0 (log t))) y)) (+ (+ x y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -2e+130) {
tmp = t_1 + (x + (z + y));
} else if (t_1 <= 5e+36) {
tmp = x + ((z * (1.0 - log(t))) + y);
} else {
tmp = (x + y) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if (t_1 <= (-2d+130)) then
tmp = t_1 + (x + (z + y))
else if (t_1 <= 5d+36) then
tmp = x + ((z * (1.0d0 - log(t))) + y)
else
tmp = (x + y) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -2e+130) {
tmp = t_1 + (x + (z + y));
} else if (t_1 <= 5e+36) {
tmp = x + ((z * (1.0 - Math.log(t))) + y);
} else {
tmp = (x + y) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if t_1 <= -2e+130: tmp = t_1 + (x + (z + y)) elif t_1 <= 5e+36: tmp = x + ((z * (1.0 - math.log(t))) + y) else: tmp = (x + y) + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (t_1 <= -2e+130) tmp = Float64(t_1 + Float64(x + Float64(z + y))); elseif (t_1 <= 5e+36) tmp = Float64(x + Float64(Float64(z * Float64(1.0 - log(t))) + y)); else tmp = Float64(Float64(x + y) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if (t_1 <= -2e+130) tmp = t_1 + (x + (z + y)); elseif (t_1 <= 5e+36) tmp = x + ((z * (1.0 - log(t))) + y); else tmp = (x + y) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+130], N[(t$95$1 + N[(x + N[(z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+36], N[(x + N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+130}:\\
\;\;\;\;t\_1 + \left(x + \left(z + y\right)\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+36}:\\
\;\;\;\;x + \left(z \cdot \left(1 - \log t\right) + y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -2.0000000000000001e130Initial program 99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
if -2.0000000000000001e130 < (*.f64 (-.f64 a 1/2) b) < 4.99999999999999977e36Initial 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 95.4%
if 4.99999999999999977e36 < (*.f64 (-.f64 a 1/2) b) Initial program 100.0%
Taylor expanded in z around 0 95.2%
Final simplification94.7%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -1.4e+247)
(not
(or (<= z 1.15e+94) (and (not (<= z 1.85e+121)) (<= z 1.05e+180)))))
(* z (- 1.0 (log t)))
(+ (* b (- a 0.5)) (+ x (+ z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.4e+247) || !((z <= 1.15e+94) || (!(z <= 1.85e+121) && (z <= 1.05e+180)))) {
tmp = z * (1.0 - log(t));
} else {
tmp = (b * (a - 0.5)) + (x + (z + 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 ((z <= (-1.4d+247)) .or. (.not. (z <= 1.15d+94) .or. (.not. (z <= 1.85d+121)) .and. (z <= 1.05d+180))) then
tmp = z * (1.0d0 - log(t))
else
tmp = (b * (a - 0.5d0)) + (x + (z + 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 ((z <= -1.4e+247) || !((z <= 1.15e+94) || (!(z <= 1.85e+121) && (z <= 1.05e+180)))) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = (b * (a - 0.5)) + (x + (z + y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.4e+247) or not ((z <= 1.15e+94) or (not (z <= 1.85e+121) and (z <= 1.05e+180))): tmp = z * (1.0 - math.log(t)) else: tmp = (b * (a - 0.5)) + (x + (z + y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.4e+247) || !((z <= 1.15e+94) || (!(z <= 1.85e+121) && (z <= 1.05e+180)))) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(Float64(b * Float64(a - 0.5)) + Float64(x + Float64(z + y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.4e+247) || ~(((z <= 1.15e+94) || (~((z <= 1.85e+121)) && (z <= 1.05e+180))))) tmp = z * (1.0 - log(t)); else tmp = (b * (a - 0.5)) + (x + (z + y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.4e+247], N[Not[Or[LessEqual[z, 1.15e+94], And[N[Not[LessEqual[z, 1.85e+121]], $MachinePrecision], LessEqual[z, 1.05e+180]]]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + N[(z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+247} \lor \neg \left(z \leq 1.15 \cdot 10^{+94} \lor \neg \left(z \leq 1.85 \cdot 10^{+121}\right) \land z \leq 1.05 \cdot 10^{+180}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a - 0.5\right) + \left(x + \left(z + y\right)\right)\\
\end{array}
\end{array}
if z < -1.3999999999999999e247 or 1.15e94 < z < 1.85000000000000006e121 or 1.05e180 < z Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 84.5%
associate-+r+84.5%
+-commutative84.5%
fma-define84.5%
Simplified84.5%
Taylor expanded in z around inf 82.1%
if -1.3999999999999999e247 < z < 1.15e94 or 1.85000000000000006e121 < z < 1.05e180Initial program 99.9%
add-cube-cbrt99.7%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 88.5%
+-commutative88.5%
+-commutative88.5%
Simplified88.5%
Final simplification87.2%
(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 (* b (- a 0.5)))) (if (or (<= t_1 -5e+170) (not (<= t_1 1e+168))) (+ x 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 <= -5e+170) || !(t_1 <= 1e+168)) {
tmp = x + 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 <= (-5d+170)) .or. (.not. (t_1 <= 1d+168))) then
tmp = x + 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 <= -5e+170) || !(t_1 <= 1e+168)) {
tmp = x + 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 <= -5e+170) or not (t_1 <= 1e+168): tmp = x + 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 <= -5e+170) || !(t_1 <= 1e+168)) tmp = Float64(x + 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 <= -5e+170) || ~((t_1 <= 1e+168))) tmp = x + 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, -5e+170], N[Not[LessEqual[t$95$1, 1e+168]], $MachinePrecision]], N[(x + t$95$1), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+170} \lor \neg \left(t\_1 \leq 10^{+168}\right):\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -4.99999999999999977e170 or 9.9999999999999993e167 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 82.9%
if -4.99999999999999977e170 < (*.f64 (-.f64 a 1/2) b) < 9.9999999999999993e167Initial 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 0 92.2%
associate-+r+92.2%
+-commutative92.2%
fma-define92.2%
Simplified92.2%
Taylor expanded in z around 0 57.1%
Final simplification65.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.8e-297)
x
(if (<= y 1.26e-185)
(* a b)
(if (<= y 1.7e-86) x (if (<= y 540000000000.0) (* a b) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.8e-297) {
tmp = x;
} else if (y <= 1.26e-185) {
tmp = a * b;
} else if (y <= 1.7e-86) {
tmp = x;
} else if (y <= 540000000000.0) {
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 <= (-2.8d-297)) then
tmp = x
else if (y <= 1.26d-185) then
tmp = a * b
else if (y <= 1.7d-86) then
tmp = x
else if (y <= 540000000000.0d0) 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 <= -2.8e-297) {
tmp = x;
} else if (y <= 1.26e-185) {
tmp = a * b;
} else if (y <= 1.7e-86) {
tmp = x;
} else if (y <= 540000000000.0) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.8e-297: tmp = x elif y <= 1.26e-185: tmp = a * b elif y <= 1.7e-86: tmp = x elif y <= 540000000000.0: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.8e-297) tmp = x; elseif (y <= 1.26e-185) tmp = Float64(a * b); elseif (y <= 1.7e-86) tmp = x; elseif (y <= 540000000000.0) 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 <= -2.8e-297) tmp = x; elseif (y <= 1.26e-185) tmp = a * b; elseif (y <= 1.7e-86) tmp = x; elseif (y <= 540000000000.0) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.8e-297], x, If[LessEqual[y, 1.26e-185], N[(a * b), $MachinePrecision], If[LessEqual[y, 1.7e-86], x, If[LessEqual[y, 540000000000.0], N[(a * b), $MachinePrecision], y]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-297}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{-185}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-86}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 540000000000:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -2.79999999999999984e-297 or 1.2599999999999999e-185 < y < 1.7e-86Initial 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.2%
if -2.79999999999999984e-297 < y < 1.2599999999999999e-185 or 1.7e-86 < y < 5.4e11Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 23.3%
*-commutative23.3%
Simplified23.3%
if 5.4e11 < y Initial 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--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 53.5%
Final simplification32.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.15e+105) (not (<= b 4.5e+54))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.15e+105) || !(b <= 4.5e+54)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-1.15d+105)) .or. (.not. (b <= 4.5d+54))) then
tmp = b * (a - 0.5d0)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.15e+105) || !(b <= 4.5e+54)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.15e+105) or not (b <= 4.5e+54): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.15e+105) || !(b <= 4.5e+54)) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.15e+105) || ~((b <= 4.5e+54))) tmp = b * (a - 0.5); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.15e+105], N[Not[LessEqual[b, 4.5e+54]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.15 \cdot 10^{+105} \lor \neg \left(b \leq 4.5 \cdot 10^{+54}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -1.1499999999999999e105 or 4.49999999999999984e54 < 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-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around inf 71.5%
if -1.1499999999999999e105 < b < 4.49999999999999984e54Initial 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 0 87.9%
associate-+r+87.9%
+-commutative87.9%
fma-define87.9%
Simplified87.9%
Taylor expanded in z around 0 54.4%
Final simplification59.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= (+ x y) 40.0) (+ 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) <= 40.0) {
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) <= 40.0d0) 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) <= 40.0) {
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) <= 40.0: 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) <= 40.0) 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) <= 40.0) 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], 40.0], 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 40:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < 40Initial program 99.8%
add-cube-cbrt99.3%
pow399.4%
Applied egg-rr99.4%
Taylor expanded in x around inf 51.9%
if 40 < (+.f64 x y) Initial program 99.9%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 61.0%
Final simplification55.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.8e+174) (not (<= b 9.8e+54))) (* a b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.8e+174) || !(b <= 9.8e+54)) {
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 <= (-5.8d+174)) .or. (.not. (b <= 9.8d+54))) 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 <= -5.8e+174) || !(b <= 9.8e+54)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.8e+174) or not (b <= 9.8e+54): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.8e+174) || !(b <= 9.8e+54)) 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 <= -5.8e+174) || ~((b <= 9.8e+54))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.8e+174], N[Not[LessEqual[b, 9.8e+54]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.8 \cdot 10^{+174} \lor \neg \left(b \leq 9.8 \cdot 10^{+54}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -5.7999999999999999e174 or 9.80000000000000002e54 < 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-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 44.5%
*-commutative44.5%
Simplified44.5%
if -5.7999999999999999e174 < b < 9.80000000000000002e54Initial 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 b around 0 85.1%
associate-+r+85.1%
+-commutative85.1%
fma-define85.1%
Simplified85.1%
Taylor expanded in z around 0 53.7%
Final simplification51.3%
(FPCore (x y z t a b) :precision binary64 (+ (* b (- a 0.5)) (+ x (+ z y))))
double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (x + (z + y));
}
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 = (b * (a - 0.5d0)) + (x + (z + y))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (b * (a - 0.5)) + (x + (z + y));
}
def code(x, y, z, t, a, b): return (b * (a - 0.5)) + (x + (z + y))
function code(x, y, z, t, a, b) return Float64(Float64(b * Float64(a - 0.5)) + Float64(x + Float64(z + y))) end
function tmp = code(x, y, z, t, a, b) tmp = (b * (a - 0.5)) + (x + (z + y)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(x + N[(z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
b \cdot \left(a - 0.5\right) + \left(x + \left(z + y\right)\right)
\end{array}
Initial program 99.9%
add-cube-cbrt99.5%
pow399.5%
Applied egg-rr99.5%
Taylor expanded in z around 0 74.9%
+-commutative74.9%
+-commutative74.9%
Simplified74.9%
Final simplification74.9%
(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 73.9%
Final simplification73.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2.9e-10) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.9e-10) {
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 <= 2.9d-10) 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 <= 2.9e-10) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.9e-10: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.9e-10) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 2.9e-10) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.9e-10], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.9 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 2.89999999999999981e-10Initial 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 26.6%
if 2.89999999999999981e-10 < y Initial 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--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 49.2%
Final simplification32.7%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.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.0%
Final simplification22.0%
(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 2024052
(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)))