
(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 13 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 (let* ((t_0 (sqrt (* x 9.0)))) (+ (/ t_0 (* x 9.0)) (* t_0 (+ y -1.0)))))
double code(double x, double y) {
double t_0 = sqrt((x * 9.0));
return (t_0 / (x * 9.0)) + (t_0 * (y + -1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = sqrt((x * 9.0d0))
code = (t_0 / (x * 9.0d0)) + (t_0 * (y + (-1.0d0)))
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt((x * 9.0));
return (t_0 / (x * 9.0)) + (t_0 * (y + -1.0));
}
def code(x, y): t_0 = math.sqrt((x * 9.0)) return (t_0 / (x * 9.0)) + (t_0 * (y + -1.0))
function code(x, y) t_0 = sqrt(Float64(x * 9.0)) return Float64(Float64(t_0 / Float64(x * 9.0)) + Float64(t_0 * Float64(y + -1.0))) end
function tmp = code(x, y) t_0 = sqrt((x * 9.0)); tmp = (t_0 / (x * 9.0)) + (t_0 * (y + -1.0)); end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]}, N[(N[(t$95$0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x \cdot 9}\\
\frac{t_0}{x \cdot 9} + t_0 \cdot \left(y + -1\right)
\end{array}
\end{array}
Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.4%
associate-/l/99.4%
associate-/r/99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
sqrt-prod99.5%
metadata-eval99.5%
distribute-lft-in99.5%
clear-num99.4%
un-div-inv99.4%
metadata-eval99.4%
sqrt-prod99.5%
div-inv99.6%
metadata-eval99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
sqrt-prod99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (x y) :precision binary64 (+ (* (sqrt (* x 9.0)) (+ y -1.0)) (/ 0.3333333333333333 (sqrt x))))
double code(double x, double y) {
return (sqrt((x * 9.0)) * (y + -1.0)) + (0.3333333333333333 / sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sqrt((x * 9.0d0)) * (y + (-1.0d0))) + (0.3333333333333333d0 / sqrt(x))
end function
public static double code(double x, double y) {
return (Math.sqrt((x * 9.0)) * (y + -1.0)) + (0.3333333333333333 / Math.sqrt(x));
}
def code(x, y): return (math.sqrt((x * 9.0)) * (y + -1.0)) + (0.3333333333333333 / math.sqrt(x))
function code(x, y) return Float64(Float64(sqrt(Float64(x * 9.0)) * Float64(y + -1.0)) + Float64(0.3333333333333333 / sqrt(x))) end
function tmp = code(x, y) tmp = (sqrt((x * 9.0)) * (y + -1.0)) + (0.3333333333333333 / sqrt(x)); end
code[x_, y_] := N[(N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.3333333333333333 / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x \cdot 9} \cdot \left(y + -1\right) + \frac{0.3333333333333333}{\sqrt{x}}
\end{array}
Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.4%
associate-/l/99.4%
associate-/r/99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
sqrt-prod99.5%
metadata-eval99.5%
distribute-lft-in99.5%
clear-num99.4%
un-div-inv99.4%
metadata-eval99.4%
sqrt-prod99.5%
div-inv99.6%
metadata-eval99.6%
*-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
metadata-eval99.6%
sqrt-prod99.7%
Applied egg-rr99.7%
expm1-log1p-u96.9%
expm1-udef96.9%
clear-num96.9%
pow196.9%
pow1/296.9%
pow-div96.9%
metadata-eval96.9%
pow1/296.9%
metadata-eval96.9%
metadata-eval96.9%
div-inv96.9%
sqrt-div96.9%
clear-num96.9%
sqrt-div96.9%
metadata-eval96.9%
Applied egg-rr96.9%
expm1-def96.9%
expm1-log1p99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (/ 0.1111111111111111 x))) (t_1 (* 3.0 (* y (sqrt x)))))
(if (<= x 2.6e-122)
t_0
(if (<= x 4.1e-86)
t_1
(if (<= x 2.5e-37) t_0 (if (<= x 1.25e+156) t_1 (* (sqrt x) -3.0)))))))
double code(double x, double y) {
double t_0 = sqrt((0.1111111111111111 / x));
double t_1 = 3.0 * (y * sqrt(x));
double tmp;
if (x <= 2.6e-122) {
tmp = t_0;
} else if (x <= 4.1e-86) {
tmp = t_1;
} else if (x <= 2.5e-37) {
tmp = t_0;
} else if (x <= 1.25e+156) {
tmp = t_1;
} 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((0.1111111111111111d0 / x))
t_1 = 3.0d0 * (y * sqrt(x))
if (x <= 2.6d-122) then
tmp = t_0
else if (x <= 4.1d-86) then
tmp = t_1
else if (x <= 2.5d-37) then
tmp = t_0
else if (x <= 1.25d+156) then
tmp = t_1
else
tmp = sqrt(x) * (-3.0d0)
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 * (y * Math.sqrt(x));
double tmp;
if (x <= 2.6e-122) {
tmp = t_0;
} else if (x <= 4.1e-86) {
tmp = t_1;
} else if (x <= 2.5e-37) {
tmp = t_0;
} else if (x <= 1.25e+156) {
tmp = t_1;
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): t_0 = math.sqrt((0.1111111111111111 / x)) t_1 = 3.0 * (y * math.sqrt(x)) tmp = 0 if x <= 2.6e-122: tmp = t_0 elif x <= 4.1e-86: tmp = t_1 elif x <= 2.5e-37: tmp = t_0 elif x <= 1.25e+156: tmp = t_1 else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) t_0 = sqrt(Float64(0.1111111111111111 / x)) t_1 = Float64(3.0 * Float64(y * sqrt(x))) tmp = 0.0 if (x <= 2.6e-122) tmp = t_0; elseif (x <= 4.1e-86) tmp = t_1; elseif (x <= 2.5e-37) tmp = t_0; elseif (x <= 1.25e+156) tmp = t_1; else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt((0.1111111111111111 / x)); t_1 = 3.0 * (y * sqrt(x)); tmp = 0.0; if (x <= 2.6e-122) tmp = t_0; elseif (x <= 4.1e-86) tmp = t_1; elseif (x <= 2.5e-37) tmp = t_0; elseif (x <= 1.25e+156) tmp = t_1; else tmp = sqrt(x) * -3.0; 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[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2.6e-122], t$95$0, If[LessEqual[x, 4.1e-86], t$95$1, If[LessEqual[x, 2.5e-37], t$95$0, If[LessEqual[x, 1.25e+156], t$95$1, N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{0.1111111111111111}{x}}\\
t_1 := 3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{if}\;x \leq 2.6 \cdot 10^{-122}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-86}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-37}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+156}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 2.59999999999999975e-122 or 4.09999999999999979e-86 < x < 2.4999999999999999e-37Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
distribute-rgt-in99.3%
remove-double-neg99.3%
distribute-lft-neg-in99.3%
distribute-rgt-neg-in99.3%
mul-1-neg99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.3%
distribute-neg-frac99.3%
*-commutative99.3%
associate-/r/99.2%
associate-/l/99.2%
associate-/r/99.3%
Simplified99.3%
*-commutative99.3%
metadata-eval99.3%
sqrt-prod99.3%
pow1/299.3%
Applied egg-rr99.3%
unpow1/299.3%
Simplified99.3%
sqrt-prod99.3%
metadata-eval99.3%
+-commutative99.3%
*-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
associate-+r+99.3%
+-commutative99.3%
associate-*r*99.3%
add-sqr-sqrt93.1%
sqrt-unprod92.5%
swap-sqr92.6%
metadata-eval92.6%
swap-sqr38.5%
add-sqr-sqrt38.5%
pow238.5%
Applied egg-rr38.5%
associate-*r*38.5%
*-commutative38.5%
metadata-eval38.5%
sub-neg38.5%
Simplified38.5%
Taylor expanded in x around 0 87.9%
if 2.59999999999999975e-122 < x < 4.09999999999999979e-86 or 2.4999999999999999e-37 < x < 1.24999999999999998e156Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-lft-in99.5%
+-commutative99.5%
*-commutative99.5%
associate-*r*99.6%
cancel-sign-sub99.6%
*-commutative99.6%
associate-*r*99.4%
*-commutative99.4%
distribute-rgt-out--99.4%
distribute-lft-neg-in99.4%
cancel-sign-sub99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-in99.4%
Simplified99.5%
Taylor expanded in y around inf 63.6%
if 1.24999999999999998e156 < x Initial program 99.6%
associate--l+99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in x around inf 99.6%
Taylor expanded in y around 0 63.8%
*-commutative63.8%
Simplified63.8%
Final simplification73.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (/ 0.1111111111111111 x))) (t_1 (* (sqrt x) (* y 3.0))))
(if (<= x 2.6e-122)
t_0
(if (<= x 3.1e-86)
t_1
(if (<= x 7.3e-37) t_0 (if (<= x 1.9e+156) t_1 (* (sqrt x) -3.0)))))))
double code(double x, double y) {
double t_0 = sqrt((0.1111111111111111 / x));
double t_1 = sqrt(x) * (y * 3.0);
double tmp;
if (x <= 2.6e-122) {
tmp = t_0;
} else if (x <= 3.1e-86) {
tmp = t_1;
} else if (x <= 7.3e-37) {
tmp = t_0;
} else if (x <= 1.9e+156) {
tmp = t_1;
} 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((0.1111111111111111d0 / x))
t_1 = sqrt(x) * (y * 3.0d0)
if (x <= 2.6d-122) then
tmp = t_0
else if (x <= 3.1d-86) then
tmp = t_1
else if (x <= 7.3d-37) then
tmp = t_0
else if (x <= 1.9d+156) then
tmp = t_1
else
tmp = sqrt(x) * (-3.0d0)
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) * (y * 3.0);
double tmp;
if (x <= 2.6e-122) {
tmp = t_0;
} else if (x <= 3.1e-86) {
tmp = t_1;
} else if (x <= 7.3e-37) {
tmp = t_0;
} else if (x <= 1.9e+156) {
tmp = t_1;
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): t_0 = math.sqrt((0.1111111111111111 / x)) t_1 = math.sqrt(x) * (y * 3.0) tmp = 0 if x <= 2.6e-122: tmp = t_0 elif x <= 3.1e-86: tmp = t_1 elif x <= 7.3e-37: tmp = t_0 elif x <= 1.9e+156: tmp = t_1 else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) t_0 = sqrt(Float64(0.1111111111111111 / x)) t_1 = Float64(sqrt(x) * Float64(y * 3.0)) tmp = 0.0 if (x <= 2.6e-122) tmp = t_0; elseif (x <= 3.1e-86) tmp = t_1; elseif (x <= 7.3e-37) tmp = t_0; elseif (x <= 1.9e+156) tmp = t_1; else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt((0.1111111111111111 / x)); t_1 = sqrt(x) * (y * 3.0); tmp = 0.0; if (x <= 2.6e-122) tmp = t_0; elseif (x <= 3.1e-86) tmp = t_1; elseif (x <= 7.3e-37) tmp = t_0; elseif (x <= 1.9e+156) tmp = t_1; else tmp = sqrt(x) * -3.0; 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] * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2.6e-122], t$95$0, If[LessEqual[x, 3.1e-86], t$95$1, If[LessEqual[x, 7.3e-37], t$95$0, If[LessEqual[x, 1.9e+156], t$95$1, N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{0.1111111111111111}{x}}\\
t_1 := \sqrt{x} \cdot \left(y \cdot 3\right)\\
\mathbf{if}\;x \leq 2.6 \cdot 10^{-122}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-86}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.3 \cdot 10^{-37}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+156}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 2.59999999999999975e-122 or 3.09999999999999989e-86 < x < 7.2999999999999997e-37Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
distribute-rgt-in99.3%
remove-double-neg99.3%
distribute-lft-neg-in99.3%
distribute-rgt-neg-in99.3%
mul-1-neg99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.3%
distribute-neg-frac99.3%
*-commutative99.3%
associate-/r/99.2%
associate-/l/99.2%
associate-/r/99.3%
Simplified99.3%
*-commutative99.3%
metadata-eval99.3%
sqrt-prod99.3%
pow1/299.3%
Applied egg-rr99.3%
unpow1/299.3%
Simplified99.3%
sqrt-prod99.3%
metadata-eval99.3%
+-commutative99.3%
*-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
associate-+r+99.3%
+-commutative99.3%
associate-*r*99.3%
add-sqr-sqrt93.1%
sqrt-unprod92.5%
swap-sqr92.6%
metadata-eval92.6%
swap-sqr38.5%
add-sqr-sqrt38.5%
pow238.5%
Applied egg-rr38.5%
associate-*r*38.5%
*-commutative38.5%
metadata-eval38.5%
sub-neg38.5%
Simplified38.5%
Taylor expanded in x around 0 87.9%
if 2.59999999999999975e-122 < x < 3.09999999999999989e-86 or 7.2999999999999997e-37 < x < 1.90000000000000012e156Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-lft-in99.5%
+-commutative99.5%
*-commutative99.5%
associate-*r*99.6%
cancel-sign-sub99.6%
*-commutative99.6%
associate-*r*99.4%
*-commutative99.4%
distribute-rgt-out--99.4%
distribute-lft-neg-in99.4%
cancel-sign-sub99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-in99.4%
Simplified99.5%
Taylor expanded in y around inf 63.6%
associate-*r*63.7%
*-commutative63.7%
Simplified63.7%
if 1.90000000000000012e156 < x Initial program 99.6%
associate--l+99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in x around inf 99.6%
Taylor expanded in y around 0 63.8%
*-commutative63.8%
Simplified63.8%
Final simplification73.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (/ 0.1111111111111111 x))) (t_1 (* (sqrt (* x 9.0)) y)))
(if (<= x 2.6e-122)
t_0
(if (<= x 2.5e-86)
t_1
(if (<= x 4.8e-36) t_0 (if (<= x 3.1e+155) t_1 (* (sqrt x) -3.0)))))))
double code(double x, double y) {
double t_0 = sqrt((0.1111111111111111 / x));
double t_1 = sqrt((x * 9.0)) * y;
double tmp;
if (x <= 2.6e-122) {
tmp = t_0;
} else if (x <= 2.5e-86) {
tmp = t_1;
} else if (x <= 4.8e-36) {
tmp = t_0;
} else if (x <= 3.1e+155) {
tmp = t_1;
} 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((0.1111111111111111d0 / x))
t_1 = sqrt((x * 9.0d0)) * y
if (x <= 2.6d-122) then
tmp = t_0
else if (x <= 2.5d-86) then
tmp = t_1
else if (x <= 4.8d-36) then
tmp = t_0
else if (x <= 3.1d+155) then
tmp = t_1
else
tmp = sqrt(x) * (-3.0d0)
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 * 9.0)) * y;
double tmp;
if (x <= 2.6e-122) {
tmp = t_0;
} else if (x <= 2.5e-86) {
tmp = t_1;
} else if (x <= 4.8e-36) {
tmp = t_0;
} else if (x <= 3.1e+155) {
tmp = t_1;
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): t_0 = math.sqrt((0.1111111111111111 / x)) t_1 = math.sqrt((x * 9.0)) * y tmp = 0 if x <= 2.6e-122: tmp = t_0 elif x <= 2.5e-86: tmp = t_1 elif x <= 4.8e-36: tmp = t_0 elif x <= 3.1e+155: tmp = t_1 else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) t_0 = sqrt(Float64(0.1111111111111111 / x)) t_1 = Float64(sqrt(Float64(x * 9.0)) * y) tmp = 0.0 if (x <= 2.6e-122) tmp = t_0; elseif (x <= 2.5e-86) tmp = t_1; elseif (x <= 4.8e-36) tmp = t_0; elseif (x <= 3.1e+155) tmp = t_1; else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt((0.1111111111111111 / x)); t_1 = sqrt((x * 9.0)) * y; tmp = 0.0; if (x <= 2.6e-122) tmp = t_0; elseif (x <= 2.5e-86) tmp = t_1; elseif (x <= 4.8e-36) tmp = t_0; elseif (x <= 3.1e+155) tmp = t_1; else tmp = sqrt(x) * -3.0; 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[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[x, 2.6e-122], t$95$0, If[LessEqual[x, 2.5e-86], t$95$1, If[LessEqual[x, 4.8e-36], t$95$0, If[LessEqual[x, 3.1e+155], t$95$1, N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{0.1111111111111111}{x}}\\
t_1 := \sqrt{x \cdot 9} \cdot y\\
\mathbf{if}\;x \leq 2.6 \cdot 10^{-122}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-86}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-36}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+155}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 2.59999999999999975e-122 or 2.4999999999999999e-86 < x < 4.8e-36Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
distribute-rgt-in99.3%
remove-double-neg99.3%
distribute-lft-neg-in99.3%
distribute-rgt-neg-in99.3%
mul-1-neg99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.3%
distribute-neg-frac99.3%
*-commutative99.3%
associate-/r/99.2%
associate-/l/99.2%
associate-/r/99.3%
Simplified99.3%
*-commutative99.3%
metadata-eval99.3%
sqrt-prod99.3%
pow1/299.3%
Applied egg-rr99.3%
unpow1/299.3%
Simplified99.3%
sqrt-prod99.3%
metadata-eval99.3%
+-commutative99.3%
*-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
associate-+r+99.3%
+-commutative99.3%
associate-*r*99.3%
add-sqr-sqrt93.1%
sqrt-unprod92.5%
swap-sqr92.6%
metadata-eval92.6%
swap-sqr38.5%
add-sqr-sqrt38.5%
pow238.5%
Applied egg-rr38.5%
associate-*r*38.5%
*-commutative38.5%
metadata-eval38.5%
sub-neg38.5%
Simplified38.5%
Taylor expanded in x around 0 87.9%
if 2.59999999999999975e-122 < x < 2.4999999999999999e-86 or 4.8e-36 < x < 3.09999999999999989e155Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.6%
distribute-neg-frac99.6%
*-commutative99.6%
associate-/r/99.6%
associate-/l/99.6%
associate-/r/99.6%
Simplified99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.8%
pow1/299.8%
Applied egg-rr99.8%
unpow1/299.8%
Simplified99.8%
Taylor expanded in y around inf 63.9%
if 3.09999999999999989e155 < x Initial program 99.6%
associate--l+99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in x around inf 99.6%
Taylor expanded in y around 0 63.8%
*-commutative63.8%
Simplified63.8%
Final simplification73.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (/ 0.1111111111111111 x))) (t_1 (sqrt (* x 9.0))))
(if (<= x 2.6e-122)
t_0
(if (<= x 4.1e-86)
(* t_1 y)
(if (<= x 1.72e-34) t_0 (* t_1 (+ y -1.0)))))))
double code(double x, double y) {
double t_0 = sqrt((0.1111111111111111 / x));
double t_1 = sqrt((x * 9.0));
double tmp;
if (x <= 2.6e-122) {
tmp = t_0;
} else if (x <= 4.1e-86) {
tmp = t_1 * y;
} else if (x <= 1.72e-34) {
tmp = t_0;
} else {
tmp = t_1 * (y + -1.0);
}
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 * 9.0d0))
if (x <= 2.6d-122) then
tmp = t_0
else if (x <= 4.1d-86) then
tmp = t_1 * y
else if (x <= 1.72d-34) then
tmp = t_0
else
tmp = t_1 * (y + (-1.0d0))
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 * 9.0));
double tmp;
if (x <= 2.6e-122) {
tmp = t_0;
} else if (x <= 4.1e-86) {
tmp = t_1 * y;
} else if (x <= 1.72e-34) {
tmp = t_0;
} else {
tmp = t_1 * (y + -1.0);
}
return tmp;
}
def code(x, y): t_0 = math.sqrt((0.1111111111111111 / x)) t_1 = math.sqrt((x * 9.0)) tmp = 0 if x <= 2.6e-122: tmp = t_0 elif x <= 4.1e-86: tmp = t_1 * y elif x <= 1.72e-34: tmp = t_0 else: tmp = t_1 * (y + -1.0) return tmp
function code(x, y) t_0 = sqrt(Float64(0.1111111111111111 / x)) t_1 = sqrt(Float64(x * 9.0)) tmp = 0.0 if (x <= 2.6e-122) tmp = t_0; elseif (x <= 4.1e-86) tmp = Float64(t_1 * y); elseif (x <= 1.72e-34) tmp = t_0; else tmp = Float64(t_1 * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt((0.1111111111111111 / x)); t_1 = sqrt((x * 9.0)); tmp = 0.0; if (x <= 2.6e-122) tmp = t_0; elseif (x <= 4.1e-86) tmp = t_1 * y; elseif (x <= 1.72e-34) tmp = t_0; else tmp = t_1 * (y + -1.0); 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[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 2.6e-122], t$95$0, If[LessEqual[x, 4.1e-86], N[(t$95$1 * y), $MachinePrecision], If[LessEqual[x, 1.72e-34], t$95$0, N[(t$95$1 * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{0.1111111111111111}{x}}\\
t_1 := \sqrt{x \cdot 9}\\
\mathbf{if}\;x \leq 2.6 \cdot 10^{-122}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-86}:\\
\;\;\;\;t_1 \cdot y\\
\mathbf{elif}\;x \leq 1.72 \cdot 10^{-34}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < 2.59999999999999975e-122 or 4.09999999999999979e-86 < x < 1.7200000000000001e-34Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
distribute-rgt-in99.3%
remove-double-neg99.3%
distribute-lft-neg-in99.3%
distribute-rgt-neg-in99.3%
mul-1-neg99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.3%
distribute-neg-frac99.3%
*-commutative99.3%
associate-/r/99.2%
associate-/l/99.2%
associate-/r/99.3%
Simplified99.3%
*-commutative99.3%
metadata-eval99.3%
sqrt-prod99.3%
pow1/299.3%
Applied egg-rr99.3%
unpow1/299.3%
Simplified99.3%
sqrt-prod99.3%
metadata-eval99.3%
+-commutative99.3%
*-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
associate-+r+99.3%
+-commutative99.3%
associate-*r*99.3%
add-sqr-sqrt93.1%
sqrt-unprod92.5%
swap-sqr92.6%
metadata-eval92.6%
swap-sqr38.5%
add-sqr-sqrt38.5%
pow238.5%
Applied egg-rr38.5%
associate-*r*38.5%
*-commutative38.5%
metadata-eval38.5%
sub-neg38.5%
Simplified38.5%
Taylor expanded in x around 0 87.9%
if 2.59999999999999975e-122 < x < 4.09999999999999979e-86Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
distribute-rgt-in99.3%
remove-double-neg99.3%
distribute-lft-neg-in99.3%
distribute-rgt-neg-in99.3%
mul-1-neg99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.4%
distribute-neg-frac99.4%
*-commutative99.4%
associate-/r/99.4%
associate-/l/99.4%
associate-/r/99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in y around inf 66.8%
if 1.7200000000000001e-34 < x Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
distribute-rgt-in99.6%
remove-double-neg99.6%
distribute-lft-neg-in99.6%
distribute-rgt-neg-in99.6%
mul-1-neg99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
distribute-neg-frac99.6%
*-commutative99.6%
associate-/r/99.6%
associate-/l/99.6%
associate-/r/99.6%
Simplified99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.8%
pow1/299.8%
Applied egg-rr99.8%
unpow1/299.8%
Simplified99.8%
Taylor expanded in x around inf 98.6%
Final simplification92.5%
(FPCore (x y) :precision binary64 (if (or (<= y -7.5e+55) (not (<= y 5.4e+113))) (* (sqrt (* x 9.0)) y) (* (sqrt x) (+ -3.0 (/ 0.3333333333333333 x)))))
double code(double x, double y) {
double tmp;
if ((y <= -7.5e+55) || !(y <= 5.4e+113)) {
tmp = sqrt((x * 9.0)) * y;
} else {
tmp = sqrt(x) * (-3.0 + (0.3333333333333333 / x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-7.5d+55)) .or. (.not. (y <= 5.4d+113))) then
tmp = sqrt((x * 9.0d0)) * y
else
tmp = sqrt(x) * ((-3.0d0) + (0.3333333333333333d0 / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -7.5e+55) || !(y <= 5.4e+113)) {
tmp = Math.sqrt((x * 9.0)) * y;
} else {
tmp = Math.sqrt(x) * (-3.0 + (0.3333333333333333 / x));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -7.5e+55) or not (y <= 5.4e+113): tmp = math.sqrt((x * 9.0)) * y else: tmp = math.sqrt(x) * (-3.0 + (0.3333333333333333 / x)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -7.5e+55) || !(y <= 5.4e+113)) tmp = Float64(sqrt(Float64(x * 9.0)) * y); else tmp = Float64(sqrt(x) * Float64(-3.0 + Float64(0.3333333333333333 / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -7.5e+55) || ~((y <= 5.4e+113))) tmp = sqrt((x * 9.0)) * y; else tmp = sqrt(x) * (-3.0 + (0.3333333333333333 / x)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -7.5e+55], N[Not[LessEqual[y, 5.4e+113]], $MachinePrecision]], N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+55} \lor \neg \left(y \leq 5.4 \cdot 10^{+113}\right):\\
\;\;\;\;\sqrt{x \cdot 9} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(-3 + \frac{0.3333333333333333}{x}\right)\\
\end{array}
\end{array}
if y < -7.50000000000000014e55 or 5.40000000000000022e113 < y Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
distribute-rgt-in99.6%
remove-double-neg99.6%
distribute-lft-neg-in99.6%
distribute-rgt-neg-in99.6%
mul-1-neg99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
distribute-neg-frac99.6%
*-commutative99.6%
associate-/r/99.6%
associate-/l/99.6%
associate-/r/99.6%
Simplified99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in y around inf 84.1%
if -7.50000000000000014e55 < y < 5.40000000000000022e113Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
distribute-lft-in99.4%
+-commutative99.4%
*-commutative99.4%
associate-*r*99.4%
cancel-sign-sub99.4%
*-commutative99.4%
associate-*r*99.4%
*-commutative99.4%
distribute-rgt-out--99.4%
distribute-lft-neg-in99.4%
cancel-sign-sub99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-in99.4%
Simplified99.4%
Taylor expanded in y around 0 89.7%
*-commutative89.7%
sub-neg89.7%
associate-*r/89.8%
metadata-eval89.8%
metadata-eval89.8%
Simplified89.8%
Final simplification87.8%
(FPCore (x y) :precision binary64 (* 3.0 (* (sqrt x) (+ (/ 0.1111111111111111 x) (+ y -1.0)))))
double code(double x, double y) {
return 3.0 * (sqrt(x) * ((0.1111111111111111 / x) + (y + -1.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 3.0d0 * (sqrt(x) * ((0.1111111111111111d0 / x) + (y + (-1.0d0))))
end function
public static double code(double x, double y) {
return 3.0 * (Math.sqrt(x) * ((0.1111111111111111 / x) + (y + -1.0)));
}
def code(x, y): return 3.0 * (math.sqrt(x) * ((0.1111111111111111 / x) + (y + -1.0)))
function code(x, y) return Float64(3.0 * Float64(sqrt(x) * Float64(Float64(0.1111111111111111 / x) + Float64(y + -1.0)))) end
function tmp = code(x, y) tmp = 3.0 * (sqrt(x) * ((0.1111111111111111 / x) + (y + -1.0))); end
code[x_, y_] := N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
3 \cdot \left(\sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.4%
associate-/l/99.4%
associate-/r/99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
Taylor expanded in y around 0 99.4%
distribute-lft-out99.4%
+-commutative99.4%
distribute-rgt-out99.3%
associate--l+99.3%
sub-neg99.3%
associate-*r/99.4%
metadata-eval99.4%
+-commutative99.4%
metadata-eval99.4%
associate-+r+99.4%
metadata-eval99.4%
sub-neg99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y) :precision binary64 (* (sqrt x) (+ (* y 3.0) (+ -3.0 (/ 0.3333333333333333 x)))))
double code(double x, double y) {
return sqrt(x) * ((y * 3.0) + (-3.0 + (0.3333333333333333 / x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(x) * ((y * 3.0d0) + ((-3.0d0) + (0.3333333333333333d0 / x)))
end function
public static double code(double x, double y) {
return Math.sqrt(x) * ((y * 3.0) + (-3.0 + (0.3333333333333333 / x)));
}
def code(x, y): return math.sqrt(x) * ((y * 3.0) + (-3.0 + (0.3333333333333333 / x)))
function code(x, y) return Float64(sqrt(x) * Float64(Float64(y * 3.0) + Float64(-3.0 + Float64(0.3333333333333333 / x)))) end
function tmp = code(x, y) tmp = sqrt(x) * ((y * 3.0) + (-3.0 + (0.3333333333333333 / x))); end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(N[(y * 3.0), $MachinePrecision] + N[(-3.0 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x} \cdot \left(y \cdot 3 + \left(-3 + \frac{0.3333333333333333}{x}\right)\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.4%
associate-/l/99.4%
associate-/r/99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
sqrt-prod99.5%
metadata-eval99.5%
+-commutative99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
associate-+r+99.5%
+-commutative99.5%
associate-*r*99.4%
add-sqr-sqrt54.9%
sqrt-unprod46.8%
swap-sqr46.8%
metadata-eval46.8%
swap-sqr25.2%
add-sqr-sqrt25.2%
pow225.2%
Applied egg-rr25.2%
associate-*r*25.2%
*-commutative25.2%
metadata-eval25.2%
sub-neg25.2%
Simplified25.2%
Taylor expanded in y around 0 99.4%
+-commutative99.4%
associate-*r*99.4%
sub-neg99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
+-commutative99.4%
associate-*r*99.4%
distribute-lft-in99.4%
metadata-eval99.4%
distribute-rgt-out99.4%
associate-*r/99.4%
metadata-eval99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y) :precision binary64 (* (sqrt (* x 9.0)) (+ (/ 0.1111111111111111 x) (+ y -1.0))))
double code(double x, double y) {
return sqrt((x * 9.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 * 9.0d0)) * ((0.1111111111111111d0 / x) + (y + (-1.0d0)))
end function
public static double code(double x, double y) {
return Math.sqrt((x * 9.0)) * ((0.1111111111111111 / x) + (y + -1.0));
}
def code(x, y): return math.sqrt((x * 9.0)) * ((0.1111111111111111 / x) + (y + -1.0))
function code(x, y) return Float64(sqrt(Float64(x * 9.0)) * Float64(Float64(0.1111111111111111 / x) + Float64(y + -1.0))) end
function tmp = code(x, y) tmp = sqrt((x * 9.0)) * ((0.1111111111111111 / x) + (y + -1.0)); end
code[x_, y_] := N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x \cdot 9} \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.4%
associate-/l/99.4%
associate-/r/99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y) :precision binary64 (if (<= x 0.48) (sqrt (/ 0.1111111111111111 x)) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if (x <= 0.48) {
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.48d0) 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.48) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.48: 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.48) 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.48) tmp = sqrt((0.1111111111111111 / x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.48], 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.48:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 0.47999999999999998Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
distribute-rgt-in99.3%
remove-double-neg99.3%
distribute-lft-neg-in99.3%
distribute-rgt-neg-in99.3%
mul-1-neg99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.3%
distribute-neg-frac99.3%
*-commutative99.3%
associate-/r/99.3%
associate-/l/99.3%
associate-/r/99.3%
Simplified99.3%
*-commutative99.3%
metadata-eval99.3%
sqrt-prod99.4%
pow1/299.4%
Applied egg-rr99.4%
unpow1/299.4%
Simplified99.4%
sqrt-prod99.3%
metadata-eval99.3%
+-commutative99.3%
*-commutative99.3%
sub-neg99.3%
metadata-eval99.3%
associate-+r+99.3%
+-commutative99.3%
associate-*r*99.3%
add-sqr-sqrt90.1%
sqrt-unprod86.6%
swap-sqr86.6%
metadata-eval86.6%
swap-sqr41.8%
add-sqr-sqrt41.8%
pow241.8%
Applied egg-rr41.8%
associate-*r*41.8%
*-commutative41.8%
metadata-eval41.8%
sub-neg41.8%
Simplified41.8%
Taylor expanded in x around 0 78.3%
if 0.47999999999999998 < x Initial program 99.6%
associate--l+99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in x around inf 99.1%
Taylor expanded in y around 0 52.0%
*-commutative52.0%
Simplified52.0%
Final simplification64.6%
(FPCore (x y) :precision binary64 (sqrt (* x 9.0)))
double code(double x, double y) {
return sqrt((x * 9.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt((x * 9.0d0))
end function
public static double code(double x, double y) {
return Math.sqrt((x * 9.0));
}
def code(x, y): return math.sqrt((x * 9.0))
function code(x, y) return sqrt(Float64(x * 9.0)) end
function tmp = code(x, y) tmp = sqrt((x * 9.0)); end
code[x_, y_] := N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x \cdot 9}
\end{array}
Initial program 99.5%
associate--l+99.5%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in x around inf 62.6%
Taylor expanded in y around 0 27.8%
*-commutative27.8%
Simplified27.8%
add-sqr-sqrt0.0%
sqrt-unprod3.1%
swap-sqr3.1%
add-sqr-sqrt3.1%
metadata-eval3.1%
pow1/23.1%
Applied egg-rr3.1%
unpow1/23.1%
Simplified3.1%
Final simplification3.1%
(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.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.4%
associate-/l/99.4%
associate-/r/99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
sqrt-prod99.5%
metadata-eval99.5%
+-commutative99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
associate-+r+99.5%
+-commutative99.5%
associate-*r*99.4%
add-sqr-sqrt54.9%
sqrt-unprod46.8%
swap-sqr46.8%
metadata-eval46.8%
swap-sqr25.2%
add-sqr-sqrt25.2%
pow225.2%
Applied egg-rr25.2%
associate-*r*25.2%
*-commutative25.2%
metadata-eval25.2%
sub-neg25.2%
Simplified25.2%
Taylor expanded in x around 0 38.6%
Final simplification38.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 2023185
(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)))