
(FPCore (x y) :precision binary64 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
double code(double x, double y) {
return (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (3.0d0 * sqrt(x)) * ((y + (1.0d0 / (x * 9.0d0))) - 1.0d0)
end function
public static double code(double x, double y) {
return (3.0 * Math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
def code(x, y): return (3.0 * math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0)
function code(x, y) return Float64(Float64(3.0 * sqrt(x)) * Float64(Float64(y + Float64(1.0 / Float64(x * 9.0))) - 1.0)) end
function tmp = code(x, y) tmp = (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0); end
code[x_, y_] := N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
double code(double x, double y) {
return (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (3.0d0 * sqrt(x)) * ((y + (1.0d0 / (x * 9.0d0))) - 1.0d0)
end function
public static double code(double x, double y) {
return (3.0 * Math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
def code(x, y): return (3.0 * math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0)
function code(x, y) return Float64(Float64(3.0 * sqrt(x)) * Float64(Float64(y + Float64(1.0 / Float64(x * 9.0))) - 1.0)) end
function tmp = code(x, y) tmp = (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0); end
code[x_, y_] := N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\end{array}
(FPCore (x y) :precision binary64 (* (sqrt x) (fma 3.0 y (+ -3.0 (/ 0.3333333333333333 x)))))
double code(double x, double y) {
return sqrt(x) * fma(3.0, y, (-3.0 + (0.3333333333333333 / x)));
}
function code(x, y) return Float64(sqrt(x) * fma(3.0, y, Float64(-3.0 + Float64(0.3333333333333333 / x)))) end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * y + N[(-3.0 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x} \cdot \mathsf{fma}\left(3, y, -3 + \frac{0.3333333333333333}{x}\right)
\end{array}
Initial program 99.4%
*-commutative99.4%
associate-*l*99.6%
associate--l+99.6%
distribute-lft-in99.6%
fma-def99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (/ 0.1111111111111111 x)))
(t_1 (* 3.0 (* (sqrt x) y)))
(t_2 (* (sqrt x) -3.0)))
(if (<= y -8e-6)
t_1
(if (<= y -4.35e-225)
t_2
(if (<= y 3.7e-297)
t_0
(if (<= y 5e-252)
t_2
(if (or (<= y 2100000000.0)
(and (not (<= y 1.7e+59)) (<= y 2.35e+113)))
t_0
t_1)))))))
double code(double x, double y) {
double t_0 = sqrt((0.1111111111111111 / x));
double t_1 = 3.0 * (sqrt(x) * y);
double t_2 = sqrt(x) * -3.0;
double tmp;
if (y <= -8e-6) {
tmp = t_1;
} else if (y <= -4.35e-225) {
tmp = t_2;
} else if (y <= 3.7e-297) {
tmp = t_0;
} else if (y <= 5e-252) {
tmp = t_2;
} else if ((y <= 2100000000.0) || (!(y <= 1.7e+59) && (y <= 2.35e+113))) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = sqrt((0.1111111111111111d0 / x))
t_1 = 3.0d0 * (sqrt(x) * y)
t_2 = sqrt(x) * (-3.0d0)
if (y <= (-8d-6)) then
tmp = t_1
else if (y <= (-4.35d-225)) then
tmp = t_2
else if (y <= 3.7d-297) then
tmp = t_0
else if (y <= 5d-252) then
tmp = t_2
else if ((y <= 2100000000.0d0) .or. (.not. (y <= 1.7d+59)) .and. (y <= 2.35d+113)) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt((0.1111111111111111 / x));
double t_1 = 3.0 * (Math.sqrt(x) * y);
double t_2 = Math.sqrt(x) * -3.0;
double tmp;
if (y <= -8e-6) {
tmp = t_1;
} else if (y <= -4.35e-225) {
tmp = t_2;
} else if (y <= 3.7e-297) {
tmp = t_0;
} else if (y <= 5e-252) {
tmp = t_2;
} else if ((y <= 2100000000.0) || (!(y <= 1.7e+59) && (y <= 2.35e+113))) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y): t_0 = math.sqrt((0.1111111111111111 / x)) t_1 = 3.0 * (math.sqrt(x) * y) t_2 = math.sqrt(x) * -3.0 tmp = 0 if y <= -8e-6: tmp = t_1 elif y <= -4.35e-225: tmp = t_2 elif y <= 3.7e-297: tmp = t_0 elif y <= 5e-252: tmp = t_2 elif (y <= 2100000000.0) or (not (y <= 1.7e+59) and (y <= 2.35e+113)): tmp = t_0 else: tmp = t_1 return tmp
function code(x, y) t_0 = sqrt(Float64(0.1111111111111111 / x)) t_1 = Float64(3.0 * Float64(sqrt(x) * y)) t_2 = Float64(sqrt(x) * -3.0) tmp = 0.0 if (y <= -8e-6) tmp = t_1; elseif (y <= -4.35e-225) tmp = t_2; elseif (y <= 3.7e-297) tmp = t_0; elseif (y <= 5e-252) tmp = t_2; elseif ((y <= 2100000000.0) || (!(y <= 1.7e+59) && (y <= 2.35e+113))) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt((0.1111111111111111 / x)); t_1 = 3.0 * (sqrt(x) * y); t_2 = sqrt(x) * -3.0; tmp = 0.0; if (y <= -8e-6) tmp = t_1; elseif (y <= -4.35e-225) tmp = t_2; elseif (y <= 3.7e-297) tmp = t_0; elseif (y <= 5e-252) tmp = t_2; elseif ((y <= 2100000000.0) || (~((y <= 1.7e+59)) && (y <= 2.35e+113))) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]}, If[LessEqual[y, -8e-6], t$95$1, If[LessEqual[y, -4.35e-225], t$95$2, If[LessEqual[y, 3.7e-297], t$95$0, If[LessEqual[y, 5e-252], t$95$2, If[Or[LessEqual[y, 2100000000.0], And[N[Not[LessEqual[y, 1.7e+59]], $MachinePrecision], LessEqual[y, 2.35e+113]]], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{0.1111111111111111}{x}}\\
t_1 := 3 \cdot \left(\sqrt{x} \cdot y\right)\\
t_2 := \sqrt{x} \cdot -3\\
\mathbf{if}\;y \leq -8 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -4.35 \cdot 10^{-225}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-297}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-252}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2100000000 \lor \neg \left(y \leq 1.7 \cdot 10^{+59}\right) \land y \leq 2.35 \cdot 10^{+113}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -7.99999999999999964e-6 or 2.1e9 < y < 1.70000000000000003e59 or 2.3499999999999999e113 < y Initial program 99.5%
associate-*l*99.6%
associate--l+99.6%
sub-neg99.6%
*-commutative99.6%
associate-/r*99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 79.3%
*-commutative79.3%
Simplified79.3%
if -7.99999999999999964e-6 < y < -4.3500000000000003e-225 or 3.7e-297 < y < 5.00000000000000008e-252Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-def99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
associate-*r/99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 97.3%
*-commutative97.3%
sub-neg97.3%
metadata-eval97.3%
associate-*r/97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in x around inf 61.0%
if -4.3500000000000003e-225 < y < 3.7e-297 or 5.00000000000000008e-252 < y < 2.1e9 or 1.70000000000000003e59 < y < 2.3499999999999999e113Initial program 99.3%
associate-*l*99.3%
associate--l+99.3%
sub-neg99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 58.1%
expm1-log1p-u54.4%
expm1-udef54.6%
associate-*r*54.6%
*-commutative54.6%
metadata-eval54.6%
sqrt-prod54.6%
add-sqr-sqrt54.6%
metadata-eval54.6%
swap-sqr54.6%
sqrt-unprod0.0%
add-sqr-sqrt1.1%
Applied egg-rr1.1%
expm1-def1.6%
expm1-log1p2.2%
*-commutative2.2%
associate-*r*2.2%
associate-*l/2.2%
*-commutative2.2%
rem-square-sqrt2.2%
times-frac2.2%
*-inverses2.2%
*-lft-identity2.2%
metadata-eval2.2%
metadata-eval2.2%
*-inverses2.2%
associate-/l*2.2%
associate-*l/2.2%
associate-*r/2.2%
associate-*r*2.2%
*-commutative2.2%
associate-*r*2.2%
associate-*r*2.2%
*-commutative2.2%
Simplified2.2%
add-sqr-sqrt0.0%
sqrt-unprod58.4%
frac-times58.4%
metadata-eval58.4%
add-sqr-sqrt58.5%
pow1/258.5%
Applied egg-rr58.5%
unpow1/258.5%
Simplified58.5%
Final simplification68.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (/ 0.1111111111111111 x))) (t_1 (* (sqrt x) -3.0)))
(if (<= y -8e-6)
(* 3.0 (* (sqrt x) y))
(if (<= y -1.26e-225)
t_1
(if (<= y 6.5e-297)
t_0
(if (<= y 9.5e-252)
t_1
(if (or (<= y 56000000000.0)
(and (not (<= y 5.9e+56)) (<= y 2.35e+113)))
t_0
(* (sqrt x) (* 3.0 y)))))))))
double code(double x, double y) {
double t_0 = sqrt((0.1111111111111111 / x));
double t_1 = sqrt(x) * -3.0;
double tmp;
if (y <= -8e-6) {
tmp = 3.0 * (sqrt(x) * y);
} else if (y <= -1.26e-225) {
tmp = t_1;
} else if (y <= 6.5e-297) {
tmp = t_0;
} else if (y <= 9.5e-252) {
tmp = t_1;
} else if ((y <= 56000000000.0) || (!(y <= 5.9e+56) && (y <= 2.35e+113))) {
tmp = t_0;
} else {
tmp = sqrt(x) * (3.0 * y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((0.1111111111111111d0 / x))
t_1 = sqrt(x) * (-3.0d0)
if (y <= (-8d-6)) then
tmp = 3.0d0 * (sqrt(x) * y)
else if (y <= (-1.26d-225)) then
tmp = t_1
else if (y <= 6.5d-297) then
tmp = t_0
else if (y <= 9.5d-252) then
tmp = t_1
else if ((y <= 56000000000.0d0) .or. (.not. (y <= 5.9d+56)) .and. (y <= 2.35d+113)) then
tmp = t_0
else
tmp = sqrt(x) * (3.0d0 * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt((0.1111111111111111 / x));
double t_1 = Math.sqrt(x) * -3.0;
double tmp;
if (y <= -8e-6) {
tmp = 3.0 * (Math.sqrt(x) * y);
} else if (y <= -1.26e-225) {
tmp = t_1;
} else if (y <= 6.5e-297) {
tmp = t_0;
} else if (y <= 9.5e-252) {
tmp = t_1;
} else if ((y <= 56000000000.0) || (!(y <= 5.9e+56) && (y <= 2.35e+113))) {
tmp = t_0;
} else {
tmp = Math.sqrt(x) * (3.0 * y);
}
return tmp;
}
def code(x, y): t_0 = math.sqrt((0.1111111111111111 / x)) t_1 = math.sqrt(x) * -3.0 tmp = 0 if y <= -8e-6: tmp = 3.0 * (math.sqrt(x) * y) elif y <= -1.26e-225: tmp = t_1 elif y <= 6.5e-297: tmp = t_0 elif y <= 9.5e-252: tmp = t_1 elif (y <= 56000000000.0) or (not (y <= 5.9e+56) and (y <= 2.35e+113)): tmp = t_0 else: tmp = math.sqrt(x) * (3.0 * y) return tmp
function code(x, y) t_0 = sqrt(Float64(0.1111111111111111 / x)) t_1 = Float64(sqrt(x) * -3.0) tmp = 0.0 if (y <= -8e-6) tmp = Float64(3.0 * Float64(sqrt(x) * y)); elseif (y <= -1.26e-225) tmp = t_1; elseif (y <= 6.5e-297) tmp = t_0; elseif (y <= 9.5e-252) tmp = t_1; elseif ((y <= 56000000000.0) || (!(y <= 5.9e+56) && (y <= 2.35e+113))) tmp = t_0; else tmp = Float64(sqrt(x) * Float64(3.0 * y)); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt((0.1111111111111111 / x)); t_1 = sqrt(x) * -3.0; tmp = 0.0; if (y <= -8e-6) tmp = 3.0 * (sqrt(x) * y); elseif (y <= -1.26e-225) tmp = t_1; elseif (y <= 6.5e-297) tmp = t_0; elseif (y <= 9.5e-252) tmp = t_1; elseif ((y <= 56000000000.0) || (~((y <= 5.9e+56)) && (y <= 2.35e+113))) tmp = t_0; else tmp = sqrt(x) * (3.0 * y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]}, If[LessEqual[y, -8e-6], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.26e-225], t$95$1, If[LessEqual[y, 6.5e-297], t$95$0, If[LessEqual[y, 9.5e-252], t$95$1, If[Or[LessEqual[y, 56000000000.0], And[N[Not[LessEqual[y, 5.9e+56]], $MachinePrecision], LessEqual[y, 2.35e+113]]], t$95$0, N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * y), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{0.1111111111111111}{x}}\\
t_1 := \sqrt{x} \cdot -3\\
\mathbf{if}\;y \leq -8 \cdot 10^{-6}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\
\mathbf{elif}\;y \leq -1.26 \cdot 10^{-225}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-297}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-252}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 56000000000 \lor \neg \left(y \leq 5.9 \cdot 10^{+56}\right) \land y \leq 2.35 \cdot 10^{+113}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(3 \cdot y\right)\\
\end{array}
\end{array}
if y < -7.99999999999999964e-6Initial program 99.4%
associate-*l*99.5%
associate--l+99.5%
sub-neg99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 74.1%
*-commutative74.1%
Simplified74.1%
if -7.99999999999999964e-6 < y < -1.2599999999999999e-225 or 6.5000000000000002e-297 < y < 9.4999999999999993e-252Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-def99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
associate-*r/99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 97.3%
*-commutative97.3%
sub-neg97.3%
metadata-eval97.3%
associate-*r/97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in x around inf 61.0%
if -1.2599999999999999e-225 < y < 6.5000000000000002e-297 or 9.4999999999999993e-252 < y < 5.6e10 or 5.9000000000000001e56 < y < 2.3499999999999999e113Initial program 99.3%
associate-*l*99.3%
associate--l+99.3%
sub-neg99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 58.1%
expm1-log1p-u54.4%
expm1-udef54.6%
associate-*r*54.6%
*-commutative54.6%
metadata-eval54.6%
sqrt-prod54.6%
add-sqr-sqrt54.6%
metadata-eval54.6%
swap-sqr54.6%
sqrt-unprod0.0%
add-sqr-sqrt1.1%
Applied egg-rr1.1%
expm1-def1.6%
expm1-log1p2.2%
*-commutative2.2%
associate-*r*2.2%
associate-*l/2.2%
*-commutative2.2%
rem-square-sqrt2.2%
times-frac2.2%
*-inverses2.2%
*-lft-identity2.2%
metadata-eval2.2%
metadata-eval2.2%
*-inverses2.2%
associate-/l*2.2%
associate-*l/2.2%
associate-*r/2.2%
associate-*r*2.2%
*-commutative2.2%
associate-*r*2.2%
associate-*r*2.2%
*-commutative2.2%
Simplified2.2%
add-sqr-sqrt0.0%
sqrt-unprod58.4%
frac-times58.4%
metadata-eval58.4%
add-sqr-sqrt58.5%
pow1/258.5%
Applied egg-rr58.5%
unpow1/258.5%
Simplified58.5%
if 5.6e10 < y < 5.9000000000000001e56 or 2.3499999999999999e113 < y Initial program 99.6%
*-commutative99.6%
associate-*l*99.9%
associate--l+99.9%
distribute-lft-in99.9%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
metadata-eval99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 87.8%
associate-*r*87.9%
Simplified87.9%
Final simplification68.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (/ 0.1111111111111111 x))) (t_1 (* (sqrt x) -3.0)))
(if (<= y -8e-6)
(* 3.0 (* (sqrt x) y))
(if (<= y -1.26e-225)
t_1
(if (<= y 3e-297)
t_0
(if (<= y 1.2e-252)
t_1
(if (<= y 56000000000.0)
t_0
(if (or (<= y 5.7e+48) (not (<= y 2.35e+113)))
(* (sqrt x) (* 3.0 y))
(/ (* (sqrt x) 0.3333333333333333) x)))))))))
double code(double x, double y) {
double t_0 = sqrt((0.1111111111111111 / x));
double t_1 = sqrt(x) * -3.0;
double tmp;
if (y <= -8e-6) {
tmp = 3.0 * (sqrt(x) * y);
} else if (y <= -1.26e-225) {
tmp = t_1;
} else if (y <= 3e-297) {
tmp = t_0;
} else if (y <= 1.2e-252) {
tmp = t_1;
} else if (y <= 56000000000.0) {
tmp = t_0;
} else if ((y <= 5.7e+48) || !(y <= 2.35e+113)) {
tmp = sqrt(x) * (3.0 * y);
} else {
tmp = (sqrt(x) * 0.3333333333333333) / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((0.1111111111111111d0 / x))
t_1 = sqrt(x) * (-3.0d0)
if (y <= (-8d-6)) then
tmp = 3.0d0 * (sqrt(x) * y)
else if (y <= (-1.26d-225)) then
tmp = t_1
else if (y <= 3d-297) then
tmp = t_0
else if (y <= 1.2d-252) then
tmp = t_1
else if (y <= 56000000000.0d0) then
tmp = t_0
else if ((y <= 5.7d+48) .or. (.not. (y <= 2.35d+113))) then
tmp = sqrt(x) * (3.0d0 * y)
else
tmp = (sqrt(x) * 0.3333333333333333d0) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt((0.1111111111111111 / x));
double t_1 = Math.sqrt(x) * -3.0;
double tmp;
if (y <= -8e-6) {
tmp = 3.0 * (Math.sqrt(x) * y);
} else if (y <= -1.26e-225) {
tmp = t_1;
} else if (y <= 3e-297) {
tmp = t_0;
} else if (y <= 1.2e-252) {
tmp = t_1;
} else if (y <= 56000000000.0) {
tmp = t_0;
} else if ((y <= 5.7e+48) || !(y <= 2.35e+113)) {
tmp = Math.sqrt(x) * (3.0 * y);
} else {
tmp = (Math.sqrt(x) * 0.3333333333333333) / x;
}
return tmp;
}
def code(x, y): t_0 = math.sqrt((0.1111111111111111 / x)) t_1 = math.sqrt(x) * -3.0 tmp = 0 if y <= -8e-6: tmp = 3.0 * (math.sqrt(x) * y) elif y <= -1.26e-225: tmp = t_1 elif y <= 3e-297: tmp = t_0 elif y <= 1.2e-252: tmp = t_1 elif y <= 56000000000.0: tmp = t_0 elif (y <= 5.7e+48) or not (y <= 2.35e+113): tmp = math.sqrt(x) * (3.0 * y) else: tmp = (math.sqrt(x) * 0.3333333333333333) / x return tmp
function code(x, y) t_0 = sqrt(Float64(0.1111111111111111 / x)) t_1 = Float64(sqrt(x) * -3.0) tmp = 0.0 if (y <= -8e-6) tmp = Float64(3.0 * Float64(sqrt(x) * y)); elseif (y <= -1.26e-225) tmp = t_1; elseif (y <= 3e-297) tmp = t_0; elseif (y <= 1.2e-252) tmp = t_1; elseif (y <= 56000000000.0) tmp = t_0; elseif ((y <= 5.7e+48) || !(y <= 2.35e+113)) tmp = Float64(sqrt(x) * Float64(3.0 * y)); else tmp = Float64(Float64(sqrt(x) * 0.3333333333333333) / x); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt((0.1111111111111111 / x)); t_1 = sqrt(x) * -3.0; tmp = 0.0; if (y <= -8e-6) tmp = 3.0 * (sqrt(x) * y); elseif (y <= -1.26e-225) tmp = t_1; elseif (y <= 3e-297) tmp = t_0; elseif (y <= 1.2e-252) tmp = t_1; elseif (y <= 56000000000.0) tmp = t_0; elseif ((y <= 5.7e+48) || ~((y <= 2.35e+113))) tmp = sqrt(x) * (3.0 * y); else tmp = (sqrt(x) * 0.3333333333333333) / x; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]}, If[LessEqual[y, -8e-6], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.26e-225], t$95$1, If[LessEqual[y, 3e-297], t$95$0, If[LessEqual[y, 1.2e-252], t$95$1, If[LessEqual[y, 56000000000.0], t$95$0, If[Or[LessEqual[y, 5.7e+48], N[Not[LessEqual[y, 2.35e+113]], $MachinePrecision]], N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * y), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[x], $MachinePrecision] * 0.3333333333333333), $MachinePrecision] / x), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{0.1111111111111111}{x}}\\
t_1 := \sqrt{x} \cdot -3\\
\mathbf{if}\;y \leq -8 \cdot 10^{-6}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\
\mathbf{elif}\;y \leq -1.26 \cdot 10^{-225}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-297}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-252}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 56000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 5.7 \cdot 10^{+48} \lor \neg \left(y \leq 2.35 \cdot 10^{+113}\right):\\
\;\;\;\;\sqrt{x} \cdot \left(3 \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{x} \cdot 0.3333333333333333}{x}\\
\end{array}
\end{array}
if y < -7.99999999999999964e-6Initial program 99.4%
associate-*l*99.5%
associate--l+99.5%
sub-neg99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 74.1%
*-commutative74.1%
Simplified74.1%
if -7.99999999999999964e-6 < y < -1.2599999999999999e-225 or 2.99999999999999995e-297 < y < 1.2000000000000001e-252Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-def99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
associate-*r/99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 97.3%
*-commutative97.3%
sub-neg97.3%
metadata-eval97.3%
associate-*r/97.5%
metadata-eval97.5%
Simplified97.5%
Taylor expanded in x around inf 61.0%
if -1.2599999999999999e-225 < y < 2.99999999999999995e-297 or 1.2000000000000001e-252 < y < 5.6e10Initial program 99.3%
associate-*l*99.3%
associate--l+99.3%
sub-neg99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 56.3%
expm1-log1p-u52.7%
expm1-udef53.0%
associate-*r*53.0%
*-commutative53.0%
metadata-eval53.0%
sqrt-prod53.0%
add-sqr-sqrt53.0%
metadata-eval53.0%
swap-sqr53.0%
sqrt-unprod0.0%
add-sqr-sqrt1.2%
Applied egg-rr1.2%
expm1-def1.8%
expm1-log1p2.4%
*-commutative2.4%
associate-*r*2.4%
associate-*l/2.4%
*-commutative2.4%
rem-square-sqrt2.4%
times-frac2.4%
*-inverses2.4%
*-lft-identity2.4%
metadata-eval2.4%
metadata-eval2.4%
*-inverses2.4%
associate-/l*2.4%
associate-*l/2.4%
associate-*r/2.4%
associate-*r*2.4%
*-commutative2.4%
associate-*r*2.4%
associate-*r*2.4%
*-commutative2.4%
Simplified2.4%
add-sqr-sqrt0.0%
sqrt-unprod56.5%
frac-times56.6%
metadata-eval56.6%
add-sqr-sqrt56.6%
pow1/256.6%
Applied egg-rr56.6%
unpow1/256.6%
Simplified56.6%
if 5.6e10 < y < 5.69999999999999968e48 or 2.3499999999999999e113 < y Initial program 99.6%
*-commutative99.6%
associate-*l*99.9%
associate--l+99.9%
distribute-lft-in99.9%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
metadata-eval99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 87.8%
associate-*r*87.9%
Simplified87.9%
if 5.69999999999999968e48 < y < 2.3499999999999999e113Initial program 99.3%
associate-*l*99.2%
associate--l+99.2%
sub-neg99.2%
*-commutative99.2%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 65.3%
associate-*r/65.5%
associate-*r/65.5%
*-commutative65.5%
Applied egg-rr65.5%
associate-*r*65.7%
metadata-eval65.7%
Simplified65.7%
Final simplification68.3%
(FPCore (x y)
:precision binary64
(if (<= x 1.45e-55)
(sqrt (/ 0.1111111111111111 x))
(if (<= x 2.5e-28)
(* (sqrt x) (* 3.0 y))
(if (<= x 4.6e-9)
(* (sqrt x) (- (/ 1.0 (/ x 0.3333333333333333)) 3.0))
(* (sqrt x) (* 3.0 (+ y -1.0)))))))
double code(double x, double y) {
double tmp;
if (x <= 1.45e-55) {
tmp = sqrt((0.1111111111111111 / x));
} else if (x <= 2.5e-28) {
tmp = sqrt(x) * (3.0 * y);
} else if (x <= 4.6e-9) {
tmp = sqrt(x) * ((1.0 / (x / 0.3333333333333333)) - 3.0);
} else {
tmp = sqrt(x) * (3.0 * (y + -1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.45d-55) then
tmp = sqrt((0.1111111111111111d0 / x))
else if (x <= 2.5d-28) then
tmp = sqrt(x) * (3.0d0 * y)
else if (x <= 4.6d-9) then
tmp = sqrt(x) * ((1.0d0 / (x / 0.3333333333333333d0)) - 3.0d0)
else
tmp = sqrt(x) * (3.0d0 * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.45e-55) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else if (x <= 2.5e-28) {
tmp = Math.sqrt(x) * (3.0 * y);
} else if (x <= 4.6e-9) {
tmp = Math.sqrt(x) * ((1.0 / (x / 0.3333333333333333)) - 3.0);
} else {
tmp = Math.sqrt(x) * (3.0 * (y + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.45e-55: tmp = math.sqrt((0.1111111111111111 / x)) elif x <= 2.5e-28: tmp = math.sqrt(x) * (3.0 * y) elif x <= 4.6e-9: tmp = math.sqrt(x) * ((1.0 / (x / 0.3333333333333333)) - 3.0) else: tmp = math.sqrt(x) * (3.0 * (y + -1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 1.45e-55) tmp = sqrt(Float64(0.1111111111111111 / x)); elseif (x <= 2.5e-28) tmp = Float64(sqrt(x) * Float64(3.0 * y)); elseif (x <= 4.6e-9) tmp = Float64(sqrt(x) * Float64(Float64(1.0 / Float64(x / 0.3333333333333333)) - 3.0)); else tmp = Float64(sqrt(x) * Float64(3.0 * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.45e-55) tmp = sqrt((0.1111111111111111 / x)); elseif (x <= 2.5e-28) tmp = sqrt(x) * (3.0 * y); elseif (x <= 4.6e-9) tmp = sqrt(x) * ((1.0 / (x / 0.3333333333333333)) - 3.0); else tmp = sqrt(x) * (3.0 * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.45e-55], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 2.5e-28], N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.6e-9], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(1.0 / N[(x / 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.45 \cdot 10^{-55}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-28}:\\
\;\;\;\;\sqrt{x} \cdot \left(3 \cdot y\right)\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{-9}:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{1}{\frac{x}{0.3333333333333333}} - 3\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(3 \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if x < 1.45e-55Initial program 99.3%
associate-*l*99.3%
associate--l+99.3%
sub-neg99.3%
*-commutative99.3%
associate-/r*99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 81.7%
expm1-log1p-u75.9%
expm1-udef75.9%
associate-*r*75.9%
*-commutative75.9%
metadata-eval75.9%
sqrt-prod75.9%
add-sqr-sqrt75.9%
metadata-eval75.9%
swap-sqr75.9%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
Applied egg-rr0.0%
expm1-def0.0%
expm1-log1p1.3%
*-commutative1.3%
associate-*r*1.3%
associate-*l/1.3%
*-commutative1.3%
rem-square-sqrt1.3%
times-frac1.3%
*-inverses1.3%
*-lft-identity1.3%
metadata-eval1.3%
metadata-eval1.3%
*-inverses1.3%
associate-/l*1.3%
associate-*l/1.3%
associate-*r/1.3%
associate-*r*1.3%
*-commutative1.3%
associate-*r*1.3%
associate-*r*1.3%
*-commutative1.3%
Simplified1.3%
add-sqr-sqrt0.0%
sqrt-unprod81.9%
frac-times82.0%
metadata-eval82.0%
add-sqr-sqrt82.1%
pow1/282.1%
Applied egg-rr82.1%
unpow1/282.1%
Simplified82.1%
if 1.45e-55 < x < 2.5000000000000001e-28Initial program 99.6%
*-commutative99.6%
associate-*l*99.6%
associate--l+99.6%
distribute-lft-in99.6%
fma-def99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 65.1%
associate-*r*65.4%
Simplified65.4%
if 2.5000000000000001e-28 < x < 4.5999999999999998e-9Initial program 99.4%
*-commutative99.4%
associate-*l*99.2%
associate--l+99.2%
distribute-lft-in99.4%
fma-def99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.0%
associate-*r/99.0%
metadata-eval99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around 0 75.7%
div-inv75.7%
clear-num75.9%
Applied egg-rr75.9%
if 4.5999999999999998e-9 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
distribute-rgt-in99.7%
*-commutative99.7%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
associate-*l/99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 98.2%
Final simplification89.6%
(FPCore (x y)
:precision binary64
(if (<= x 6e-55)
(sqrt (/ 0.1111111111111111 x))
(if (<= x 9.2e-29)
(* (sqrt x) (* 3.0 y))
(if (<= x 3.9e-16)
(/ (- -0.3333333333333333) (sqrt x))
(* (sqrt x) (* 3.0 (+ y -1.0)))))))
double code(double x, double y) {
double tmp;
if (x <= 6e-55) {
tmp = sqrt((0.1111111111111111 / x));
} else if (x <= 9.2e-29) {
tmp = sqrt(x) * (3.0 * y);
} else if (x <= 3.9e-16) {
tmp = -(-0.3333333333333333) / sqrt(x);
} else {
tmp = sqrt(x) * (3.0 * (y + -1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 6d-55) then
tmp = sqrt((0.1111111111111111d0 / x))
else if (x <= 9.2d-29) then
tmp = sqrt(x) * (3.0d0 * y)
else if (x <= 3.9d-16) then
tmp = -(-0.3333333333333333d0) / sqrt(x)
else
tmp = sqrt(x) * (3.0d0 * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 6e-55) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else if (x <= 9.2e-29) {
tmp = Math.sqrt(x) * (3.0 * y);
} else if (x <= 3.9e-16) {
tmp = -(-0.3333333333333333) / Math.sqrt(x);
} else {
tmp = Math.sqrt(x) * (3.0 * (y + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 6e-55: tmp = math.sqrt((0.1111111111111111 / x)) elif x <= 9.2e-29: tmp = math.sqrt(x) * (3.0 * y) elif x <= 3.9e-16: tmp = -(-0.3333333333333333) / math.sqrt(x) else: tmp = math.sqrt(x) * (3.0 * (y + -1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 6e-55) tmp = sqrt(Float64(0.1111111111111111 / x)); elseif (x <= 9.2e-29) tmp = Float64(sqrt(x) * Float64(3.0 * y)); elseif (x <= 3.9e-16) tmp = Float64(Float64(-(-0.3333333333333333)) / sqrt(x)); else tmp = Float64(sqrt(x) * Float64(3.0 * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 6e-55) tmp = sqrt((0.1111111111111111 / x)); elseif (x <= 9.2e-29) tmp = sqrt(x) * (3.0 * y); elseif (x <= 3.9e-16) tmp = -(-0.3333333333333333) / sqrt(x); else tmp = sqrt(x) * (3.0 * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 6e-55], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 9.2e-29], N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.9e-16], N[((--0.3333333333333333) / N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6 \cdot 10^{-55}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-29}:\\
\;\;\;\;\sqrt{x} \cdot \left(3 \cdot y\right)\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-16}:\\
\;\;\;\;\frac{--0.3333333333333333}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(3 \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if x < 6.00000000000000033e-55Initial program 99.3%
associate-*l*99.3%
associate--l+99.3%
sub-neg99.3%
*-commutative99.3%
associate-/r*99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 81.7%
expm1-log1p-u75.9%
expm1-udef75.9%
associate-*r*75.9%
*-commutative75.9%
metadata-eval75.9%
sqrt-prod75.9%
add-sqr-sqrt75.9%
metadata-eval75.9%
swap-sqr75.9%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
Applied egg-rr0.0%
expm1-def0.0%
expm1-log1p1.3%
*-commutative1.3%
associate-*r*1.3%
associate-*l/1.3%
*-commutative1.3%
rem-square-sqrt1.3%
times-frac1.3%
*-inverses1.3%
*-lft-identity1.3%
metadata-eval1.3%
metadata-eval1.3%
*-inverses1.3%
associate-/l*1.3%
associate-*l/1.3%
associate-*r/1.3%
associate-*r*1.3%
*-commutative1.3%
associate-*r*1.3%
associate-*r*1.3%
*-commutative1.3%
Simplified1.3%
add-sqr-sqrt0.0%
sqrt-unprod81.9%
frac-times82.0%
metadata-eval82.0%
add-sqr-sqrt82.1%
pow1/282.1%
Applied egg-rr82.1%
unpow1/282.1%
Simplified82.1%
if 6.00000000000000033e-55 < x < 9.19999999999999965e-29Initial program 99.6%
*-commutative99.6%
associate-*l*99.6%
associate--l+99.6%
distribute-lft-in99.6%
fma-def99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 65.1%
associate-*r*65.4%
Simplified65.4%
if 9.19999999999999965e-29 < x < 3.89999999999999977e-16Initial program 99.2%
associate-*l*99.0%
associate--l+99.0%
sub-neg99.0%
*-commutative99.0%
associate-/r*98.7%
metadata-eval98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in x around 0 81.3%
associate-*r/81.0%
associate-*r/81.5%
*-commutative81.5%
Applied egg-rr81.5%
*-commutative81.5%
associate-*l*81.3%
metadata-eval81.3%
distribute-rgt-neg-in81.3%
distribute-rgt-neg-out81.3%
distribute-neg-frac81.3%
*-commutative81.3%
associate-*r/81.6%
*-commutative81.6%
associate-*r*81.3%
Simplified81.6%
if 3.89999999999999977e-16 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
distribute-rgt-in99.7%
*-commutative99.7%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
associate-*l/99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 97.4%
Final simplification89.5%
(FPCore (x y)
:precision binary64
(if (<= x 2.2e-54)
(sqrt (/ 0.1111111111111111 x))
(if (<= x 5.1e-29)
(* (sqrt x) (* 3.0 y))
(if (<= x 3.1e-9)
(* (sqrt x) (+ -3.0 (/ 0.3333333333333333 x)))
(* (sqrt x) (* 3.0 (+ y -1.0)))))))
double code(double x, double y) {
double tmp;
if (x <= 2.2e-54) {
tmp = sqrt((0.1111111111111111 / x));
} else if (x <= 5.1e-29) {
tmp = sqrt(x) * (3.0 * y);
} else if (x <= 3.1e-9) {
tmp = sqrt(x) * (-3.0 + (0.3333333333333333 / x));
} else {
tmp = sqrt(x) * (3.0 * (y + -1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 2.2d-54) then
tmp = sqrt((0.1111111111111111d0 / x))
else if (x <= 5.1d-29) then
tmp = sqrt(x) * (3.0d0 * y)
else if (x <= 3.1d-9) then
tmp = sqrt(x) * ((-3.0d0) + (0.3333333333333333d0 / x))
else
tmp = sqrt(x) * (3.0d0 * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 2.2e-54) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else if (x <= 5.1e-29) {
tmp = Math.sqrt(x) * (3.0 * y);
} else if (x <= 3.1e-9) {
tmp = Math.sqrt(x) * (-3.0 + (0.3333333333333333 / x));
} else {
tmp = Math.sqrt(x) * (3.0 * (y + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 2.2e-54: tmp = math.sqrt((0.1111111111111111 / x)) elif x <= 5.1e-29: tmp = math.sqrt(x) * (3.0 * y) elif x <= 3.1e-9: tmp = math.sqrt(x) * (-3.0 + (0.3333333333333333 / x)) else: tmp = math.sqrt(x) * (3.0 * (y + -1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 2.2e-54) tmp = sqrt(Float64(0.1111111111111111 / x)); elseif (x <= 5.1e-29) tmp = Float64(sqrt(x) * Float64(3.0 * y)); elseif (x <= 3.1e-9) tmp = Float64(sqrt(x) * Float64(-3.0 + Float64(0.3333333333333333 / x))); else tmp = Float64(sqrt(x) * Float64(3.0 * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 2.2e-54) tmp = sqrt((0.1111111111111111 / x)); elseif (x <= 5.1e-29) tmp = sqrt(x) * (3.0 * y); elseif (x <= 3.1e-9) tmp = sqrt(x) * (-3.0 + (0.3333333333333333 / x)); else tmp = sqrt(x) * (3.0 * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 2.2e-54], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 5.1e-29], N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.1e-9], N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.2 \cdot 10^{-54}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{-29}:\\
\;\;\;\;\sqrt{x} \cdot \left(3 \cdot y\right)\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-9}:\\
\;\;\;\;\sqrt{x} \cdot \left(-3 + \frac{0.3333333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(3 \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if x < 2.2e-54Initial program 99.3%
associate-*l*99.3%
associate--l+99.3%
sub-neg99.3%
*-commutative99.3%
associate-/r*99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 81.7%
expm1-log1p-u75.9%
expm1-udef75.9%
associate-*r*75.9%
*-commutative75.9%
metadata-eval75.9%
sqrt-prod75.9%
add-sqr-sqrt75.9%
metadata-eval75.9%
swap-sqr75.9%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
Applied egg-rr0.0%
expm1-def0.0%
expm1-log1p1.3%
*-commutative1.3%
associate-*r*1.3%
associate-*l/1.3%
*-commutative1.3%
rem-square-sqrt1.3%
times-frac1.3%
*-inverses1.3%
*-lft-identity1.3%
metadata-eval1.3%
metadata-eval1.3%
*-inverses1.3%
associate-/l*1.3%
associate-*l/1.3%
associate-*r/1.3%
associate-*r*1.3%
*-commutative1.3%
associate-*r*1.3%
associate-*r*1.3%
*-commutative1.3%
Simplified1.3%
add-sqr-sqrt0.0%
sqrt-unprod81.9%
frac-times82.0%
metadata-eval82.0%
add-sqr-sqrt82.1%
pow1/282.1%
Applied egg-rr82.1%
unpow1/282.1%
Simplified82.1%
if 2.2e-54 < x < 5.09999999999999986e-29Initial program 99.6%
*-commutative99.6%
associate-*l*99.6%
associate--l+99.6%
distribute-lft-in99.6%
fma-def99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 65.1%
associate-*r*65.4%
Simplified65.4%
if 5.09999999999999986e-29 < x < 3.10000000000000005e-9Initial program 99.4%
*-commutative99.4%
associate-*l*99.2%
associate--l+99.2%
distribute-lft-in99.4%
fma-def99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.0%
associate-*r/99.0%
metadata-eval99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around 0 75.7%
*-commutative75.7%
sub-neg75.7%
metadata-eval75.7%
associate-*r/75.7%
metadata-eval75.7%
Simplified75.7%
if 3.10000000000000005e-9 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.7%
+-commutative99.7%
associate--l+99.7%
+-commutative99.7%
distribute-rgt-in99.7%
*-commutative99.7%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
associate-*l/99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 98.2%
Final simplification89.6%
(FPCore (x y) :precision binary64 (* 3.0 (* (sqrt x) (+ y (+ (/ 0.1111111111111111 x) -1.0)))))
double code(double x, double y) {
return 3.0 * (sqrt(x) * (y + ((0.1111111111111111 / x) + -1.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 3.0d0 * (sqrt(x) * (y + ((0.1111111111111111d0 / x) + (-1.0d0))))
end function
public static double code(double x, double y) {
return 3.0 * (Math.sqrt(x) * (y + ((0.1111111111111111 / x) + -1.0)));
}
def code(x, y): return 3.0 * (math.sqrt(x) * (y + ((0.1111111111111111 / x) + -1.0)))
function code(x, y) return Float64(3.0 * Float64(sqrt(x) * Float64(y + Float64(Float64(0.1111111111111111 / x) + -1.0)))) end
function tmp = code(x, y) tmp = 3.0 * (sqrt(x) * (y + ((0.1111111111111111 / x) + -1.0))); end
code[x_, y_] := N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(y + N[(N[(0.1111111111111111 / x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
3 \cdot \left(\sqrt{x} \cdot \left(y + \left(\frac{0.1111111111111111}{x} + -1\right)\right)\right)
\end{array}
Initial program 99.4%
associate-*l*99.5%
associate--l+99.5%
sub-neg99.5%
*-commutative99.5%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y) :precision binary64 (* (sqrt x) (* 3.0 (+ (/ 0.1111111111111111 x) (+ y -1.0)))))
double code(double x, double y) {
return sqrt(x) * (3.0 * ((0.1111111111111111 / x) + (y + -1.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(x) * (3.0d0 * ((0.1111111111111111d0 / x) + (y + (-1.0d0))))
end function
public static double code(double x, double y) {
return Math.sqrt(x) * (3.0 * ((0.1111111111111111 / x) + (y + -1.0)));
}
def code(x, y): return math.sqrt(x) * (3.0 * ((0.1111111111111111 / x) + (y + -1.0)))
function code(x, y) return Float64(sqrt(x) * Float64(3.0 * Float64(Float64(0.1111111111111111 / x) + Float64(y + -1.0)))) end
function tmp = code(x, y) tmp = sqrt(x) * (3.0 * ((0.1111111111111111 / x) + (y + -1.0))); end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x} \cdot \left(3 \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)\right)
\end{array}
Initial program 99.4%
associate-*l*99.5%
associate--l+99.5%
sub-neg99.5%
*-commutative99.5%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 99.4%
distribute-lft-out99.4%
+-commutative99.4%
distribute-rgt-out99.4%
sub-neg99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
+-commutative99.4%
*-commutative99.4%
associate-*l*99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+l+99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y) :precision binary64 (if (<= x 0.68) (sqrt (/ 0.1111111111111111 x)) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if (x <= 0.68) {
tmp = sqrt((0.1111111111111111 / x));
} else {
tmp = sqrt(x) * -3.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 0.68d0) then
tmp = sqrt((0.1111111111111111d0 / x))
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.68) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.68: tmp = math.sqrt((0.1111111111111111 / x)) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 0.68) tmp = sqrt(Float64(0.1111111111111111 / x)); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.68) tmp = sqrt((0.1111111111111111 / x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.68], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.68:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 0.680000000000000049Initial program 99.3%
associate-*l*99.3%
associate--l+99.3%
sub-neg99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 72.0%
expm1-log1p-u67.3%
expm1-udef67.3%
associate-*r*67.3%
*-commutative67.3%
metadata-eval67.3%
sqrt-prod67.3%
add-sqr-sqrt67.3%
metadata-eval67.3%
swap-sqr67.3%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
Applied egg-rr0.0%
expm1-def0.0%
expm1-log1p1.7%
*-commutative1.7%
associate-*r*1.7%
associate-*l/1.7%
*-commutative1.7%
rem-square-sqrt1.7%
times-frac1.7%
*-inverses1.7%
*-lft-identity1.7%
metadata-eval1.7%
metadata-eval1.7%
*-inverses1.7%
associate-/l*1.7%
associate-*l/1.7%
associate-*r/1.7%
associate-*r*1.7%
*-commutative1.7%
associate-*r*1.7%
associate-*r*1.7%
*-commutative1.7%
Simplified1.7%
add-sqr-sqrt0.0%
sqrt-unprod72.2%
frac-times72.2%
metadata-eval72.2%
add-sqr-sqrt72.3%
pow1/272.3%
Applied egg-rr72.3%
unpow1/272.3%
Simplified72.3%
if 0.680000000000000049 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.7%
associate--l+99.7%
distribute-lft-in99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
metadata-eval99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 47.3%
*-commutative47.3%
sub-neg47.3%
metadata-eval47.3%
associate-*r/47.3%
metadata-eval47.3%
Simplified47.3%
Taylor expanded in x around inf 47.3%
Final simplification59.6%
(FPCore (x y) :precision binary64 (sqrt (/ 0.1111111111111111 x)))
double code(double x, double y) {
return sqrt((0.1111111111111111 / x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt((0.1111111111111111d0 / x))
end function
public static double code(double x, double y) {
return Math.sqrt((0.1111111111111111 / x));
}
def code(x, y): return math.sqrt((0.1111111111111111 / x))
function code(x, y) return sqrt(Float64(0.1111111111111111 / x)) end
function tmp = code(x, y) tmp = sqrt((0.1111111111111111 / x)); end
code[x_, y_] := N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{0.1111111111111111}{x}}
\end{array}
Initial program 99.4%
associate-*l*99.5%
associate--l+99.5%
sub-neg99.5%
*-commutative99.5%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 36.4%
expm1-log1p-u34.1%
expm1-udef34.3%
associate-*r*34.3%
*-commutative34.3%
metadata-eval34.3%
sqrt-prod34.3%
add-sqr-sqrt34.3%
metadata-eval34.3%
swap-sqr34.3%
sqrt-unprod0.0%
add-sqr-sqrt1.3%
Applied egg-rr1.3%
expm1-def1.9%
expm1-log1p2.7%
*-commutative2.7%
associate-*r*2.7%
associate-*l/2.7%
*-commutative2.7%
rem-square-sqrt2.7%
times-frac2.7%
*-inverses2.7%
*-lft-identity2.7%
metadata-eval2.7%
metadata-eval2.7%
*-inverses2.7%
associate-/l*2.7%
associate-*l/2.7%
associate-*r/2.7%
associate-*r*2.7%
*-commutative2.7%
associate-*r*2.7%
associate-*r*2.7%
*-commutative2.7%
Simplified2.7%
add-sqr-sqrt0.0%
sqrt-unprod36.5%
frac-times36.5%
metadata-eval36.5%
add-sqr-sqrt36.6%
pow1/236.6%
Applied egg-rr36.6%
unpow1/236.6%
Simplified36.6%
Final simplification36.6%
(FPCore (x y) :precision binary64 (* 3.0 (+ (* y (sqrt x)) (* (- (/ 1.0 (* x 9.0)) 1.0) (sqrt x)))))
double code(double x, double y) {
return 3.0 * ((y * sqrt(x)) + (((1.0 / (x * 9.0)) - 1.0) * sqrt(x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 3.0d0 * ((y * sqrt(x)) + (((1.0d0 / (x * 9.0d0)) - 1.0d0) * sqrt(x)))
end function
public static double code(double x, double y) {
return 3.0 * ((y * Math.sqrt(x)) + (((1.0 / (x * 9.0)) - 1.0) * Math.sqrt(x)));
}
def code(x, y): return 3.0 * ((y * math.sqrt(x)) + (((1.0 / (x * 9.0)) - 1.0) * math.sqrt(x)))
function code(x, y) return Float64(3.0 * Float64(Float64(y * sqrt(x)) + Float64(Float64(Float64(1.0 / Float64(x * 9.0)) - 1.0) * sqrt(x)))) end
function tmp = code(x, y) tmp = 3.0 * ((y * sqrt(x)) + (((1.0 / (x * 9.0)) - 1.0) * sqrt(x))); end
code[x_, y_] := N[(3.0 * N[(N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
3 \cdot \left(y \cdot \sqrt{x} + \left(\frac{1}{x \cdot 9} - 1\right) \cdot \sqrt{x}\right)
\end{array}
herbie shell --seed 2023274
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(* 3.0 (+ (* y (sqrt x)) (* (- (/ 1.0 (* x 9.0)) 1.0) (sqrt x))))
(* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))