
(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 15 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 (+ (* (* 3.0 y) (sqrt x)) (* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))))
double code(double x, double y) {
return ((3.0 * y) * sqrt(x)) + (sqrt(x) * ((0.3333333333333333 / x) + -3.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((3.0d0 * y) * sqrt(x)) + (sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0)))
end function
public static double code(double x, double y) {
return ((3.0 * y) * Math.sqrt(x)) + (Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0));
}
def code(x, y): return ((3.0 * y) * math.sqrt(x)) + (math.sqrt(x) * ((0.3333333333333333 / x) + -3.0))
function code(x, y) return Float64(Float64(Float64(3.0 * y) * sqrt(x)) + Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0))) end
function tmp = code(x, y) tmp = ((3.0 * y) * sqrt(x)) + (sqrt(x) * ((0.3333333333333333 / x) + -3.0)); end
code[x_, y_] := N[(N[(N[(3.0 * y), $MachinePrecision] * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(3 \cdot y\right) \cdot \sqrt{x} + \sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)
\end{array}
Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
fma-undefine99.4%
distribute-rgt-in99.4%
+-commutative99.4%
Applied egg-rr99.4%
Final simplification99.4%
(FPCore (x y) :precision binary64 (* (sqrt x) (fma 3.0 y (+ (/ 0.3333333333333333 x) -3.0))))
double code(double x, double y) {
return sqrt(x) * fma(3.0, y, ((0.3333333333333333 / x) + -3.0));
}
function code(x, y) return Float64(sqrt(x) * fma(3.0, y, Float64(Float64(0.3333333333333333 / x) + -3.0))) end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * y + N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x} \cdot \mathsf{fma}\left(3, y, \frac{0.3333333333333333}{x} + -3\right)
\end{array}
Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (/ 0.1111111111111111 x))) (t_1 (* 3.0 (* y (sqrt x)))))
(if (<= x 2.95e-95)
t_0
(if (<= x 2.9e-55)
t_1
(if (<= x 3.2e-26)
t_0
(if (or (<= x 6.6e+84) (and (not (<= x 8.8e+176)) (<= x 2.9e+256)))
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.95e-95) {
tmp = t_0;
} else if (x <= 2.9e-55) {
tmp = t_1;
} else if (x <= 3.2e-26) {
tmp = t_0;
} else if ((x <= 6.6e+84) || (!(x <= 8.8e+176) && (x <= 2.9e+256))) {
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.95d-95) then
tmp = t_0
else if (x <= 2.9d-55) then
tmp = t_1
else if (x <= 3.2d-26) then
tmp = t_0
else if ((x <= 6.6d+84) .or. (.not. (x <= 8.8d+176)) .and. (x <= 2.9d+256)) 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.95e-95) {
tmp = t_0;
} else if (x <= 2.9e-55) {
tmp = t_1;
} else if (x <= 3.2e-26) {
tmp = t_0;
} else if ((x <= 6.6e+84) || (!(x <= 8.8e+176) && (x <= 2.9e+256))) {
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.95e-95: tmp = t_0 elif x <= 2.9e-55: tmp = t_1 elif x <= 3.2e-26: tmp = t_0 elif (x <= 6.6e+84) or (not (x <= 8.8e+176) and (x <= 2.9e+256)): 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.95e-95) tmp = t_0; elseif (x <= 2.9e-55) tmp = t_1; elseif (x <= 3.2e-26) tmp = t_0; elseif ((x <= 6.6e+84) || (!(x <= 8.8e+176) && (x <= 2.9e+256))) 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.95e-95) tmp = t_0; elseif (x <= 2.9e-55) tmp = t_1; elseif (x <= 3.2e-26) tmp = t_0; elseif ((x <= 6.6e+84) || (~((x <= 8.8e+176)) && (x <= 2.9e+256))) 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.95e-95], t$95$0, If[LessEqual[x, 2.9e-55], t$95$1, If[LessEqual[x, 3.2e-26], t$95$0, If[Or[LessEqual[x, 6.6e+84], And[N[Not[LessEqual[x, 8.8e+176]], $MachinePrecision], LessEqual[x, 2.9e+256]]], 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.95 \cdot 10^{-95}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{+84} \lor \neg \left(x \leq 8.8 \cdot 10^{+176}\right) \land x \leq 2.9 \cdot 10^{+256}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 2.9499999999999999e-95 or 2.9e-55 < x < 3.2000000000000001e-26Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
associate-+l+99.1%
*-commutative99.1%
associate-/r*99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
add-sqr-sqrt92.0%
sqrt-unprod89.4%
*-commutative89.4%
*-commutative89.4%
swap-sqr31.4%
pow231.4%
+-commutative31.4%
associate-+l+31.4%
swap-sqr31.4%
metadata-eval31.4%
add-sqr-sqrt31.5%
*-commutative31.5%
Applied egg-rr31.5%
Taylor expanded in x around 0 82.5%
if 2.9499999999999999e-95 < x < 2.9e-55 or 3.2000000000000001e-26 < x < 6.60000000000000034e84 or 8.80000000000000029e176 < x < 2.9000000000000002e256Initial program 99.4%
*-commutative99.4%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 62.8%
if 6.60000000000000034e84 < x < 8.80000000000000029e176 or 2.9000000000000002e256 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.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%
Taylor expanded in y around inf 75.6%
*-commutative75.6%
distribute-rgt-out75.7%
sub-neg75.7%
associate-*r/75.7%
metadata-eval75.7%
metadata-eval75.7%
+-commutative75.7%
Simplified75.7%
Taylor expanded in x around inf 99.2%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 64.1%
*-commutative64.1%
Simplified64.1%
Final simplification70.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (/ 0.1111111111111111 x))) (t_1 (* y (sqrt (* x 9.0)))))
(if (<= x 2.95e-95)
t_0
(if (<= x 4.2e-55)
t_1
(if (<= x 1.35e-28)
t_0
(if (or (<= x 2.1e+85) (and (not (<= x 1.95e+174)) (<= x 1.55e+257)))
t_1
(* (sqrt x) -3.0)))))))
double code(double x, double y) {
double t_0 = sqrt((0.1111111111111111 / x));
double t_1 = y * sqrt((x * 9.0));
double tmp;
if (x <= 2.95e-95) {
tmp = t_0;
} else if (x <= 4.2e-55) {
tmp = t_1;
} else if (x <= 1.35e-28) {
tmp = t_0;
} else if ((x <= 2.1e+85) || (!(x <= 1.95e+174) && (x <= 1.55e+257))) {
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 = y * sqrt((x * 9.0d0))
if (x <= 2.95d-95) then
tmp = t_0
else if (x <= 4.2d-55) then
tmp = t_1
else if (x <= 1.35d-28) then
tmp = t_0
else if ((x <= 2.1d+85) .or. (.not. (x <= 1.95d+174)) .and. (x <= 1.55d+257)) 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 = y * Math.sqrt((x * 9.0));
double tmp;
if (x <= 2.95e-95) {
tmp = t_0;
} else if (x <= 4.2e-55) {
tmp = t_1;
} else if (x <= 1.35e-28) {
tmp = t_0;
} else if ((x <= 2.1e+85) || (!(x <= 1.95e+174) && (x <= 1.55e+257))) {
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 = y * math.sqrt((x * 9.0)) tmp = 0 if x <= 2.95e-95: tmp = t_0 elif x <= 4.2e-55: tmp = t_1 elif x <= 1.35e-28: tmp = t_0 elif (x <= 2.1e+85) or (not (x <= 1.95e+174) and (x <= 1.55e+257)): 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(y * sqrt(Float64(x * 9.0))) tmp = 0.0 if (x <= 2.95e-95) tmp = t_0; elseif (x <= 4.2e-55) tmp = t_1; elseif (x <= 1.35e-28) tmp = t_0; elseif ((x <= 2.1e+85) || (!(x <= 1.95e+174) && (x <= 1.55e+257))) 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 = y * sqrt((x * 9.0)); tmp = 0.0; if (x <= 2.95e-95) tmp = t_0; elseif (x <= 4.2e-55) tmp = t_1; elseif (x <= 1.35e-28) tmp = t_0; elseif ((x <= 2.1e+85) || (~((x <= 1.95e+174)) && (x <= 1.55e+257))) 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[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2.95e-95], t$95$0, If[LessEqual[x, 4.2e-55], t$95$1, If[LessEqual[x, 1.35e-28], t$95$0, If[Or[LessEqual[x, 2.1e+85], And[N[Not[LessEqual[x, 1.95e+174]], $MachinePrecision], LessEqual[x, 1.55e+257]]], 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 := y \cdot \sqrt{x \cdot 9}\\
\mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-28}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+85} \lor \neg \left(x \leq 1.95 \cdot 10^{+174}\right) \land x \leq 1.55 \cdot 10^{+257}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 2.9499999999999999e-95 or 4.2000000000000003e-55 < x < 1.3499999999999999e-28Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
associate-+l+99.1%
*-commutative99.1%
associate-/r*99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
add-sqr-sqrt92.0%
sqrt-unprod89.4%
*-commutative89.4%
*-commutative89.4%
swap-sqr31.4%
pow231.4%
+-commutative31.4%
associate-+l+31.4%
swap-sqr31.4%
metadata-eval31.4%
add-sqr-sqrt31.5%
*-commutative31.5%
Applied egg-rr31.5%
Taylor expanded in x around 0 82.5%
if 2.9499999999999999e-95 < x < 4.2000000000000003e-55 or 1.3499999999999999e-28 < x < 2.1000000000000001e85 or 1.9499999999999999e174 < x < 1.55e257Initial program 99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 62.8%
*-commutative62.8%
*-commutative62.8%
associate-*r*62.8%
rem-square-sqrt62.8%
rem-sqrt-square62.8%
metadata-eval62.8%
fabs-mul62.8%
rem-sqrt-square62.8%
swap-sqr62.8%
rem-square-sqrt62.9%
metadata-eval62.9%
Simplified62.9%
if 2.1000000000000001e85 < x < 1.9499999999999999e174 or 1.55e257 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.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%
Taylor expanded in y around inf 75.6%
*-commutative75.6%
distribute-rgt-out75.7%
sub-neg75.7%
associate-*r/75.7%
metadata-eval75.7%
metadata-eval75.7%
+-commutative75.7%
Simplified75.7%
Taylor expanded in x around inf 99.2%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 64.1%
*-commutative64.1%
Simplified64.1%
Final simplification70.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (sqrt (* x 9.0)))))
(if (<= x 2.95e-95)
(sqrt (/ 0.1111111111111111 x))
(if (<= x 1.1e-54)
t_0
(if (<= x 1.55e-27)
(/ 1.0 (* 3.0 (sqrt x)))
(if (or (<= x 8.2e+84) (and (not (<= x 2.1e+180)) (<= x 2.4e+255)))
t_0
(* (sqrt x) -3.0)))))))
double code(double x, double y) {
double t_0 = y * sqrt((x * 9.0));
double tmp;
if (x <= 2.95e-95) {
tmp = sqrt((0.1111111111111111 / x));
} else if (x <= 1.1e-54) {
tmp = t_0;
} else if (x <= 1.55e-27) {
tmp = 1.0 / (3.0 * sqrt(x));
} else if ((x <= 8.2e+84) || (!(x <= 2.1e+180) && (x <= 2.4e+255))) {
tmp = t_0;
} 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) :: tmp
t_0 = y * sqrt((x * 9.0d0))
if (x <= 2.95d-95) then
tmp = sqrt((0.1111111111111111d0 / x))
else if (x <= 1.1d-54) then
tmp = t_0
else if (x <= 1.55d-27) then
tmp = 1.0d0 / (3.0d0 * sqrt(x))
else if ((x <= 8.2d+84) .or. (.not. (x <= 2.1d+180)) .and. (x <= 2.4d+255)) then
tmp = t_0
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * Math.sqrt((x * 9.0));
double tmp;
if (x <= 2.95e-95) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else if (x <= 1.1e-54) {
tmp = t_0;
} else if (x <= 1.55e-27) {
tmp = 1.0 / (3.0 * Math.sqrt(x));
} else if ((x <= 8.2e+84) || (!(x <= 2.1e+180) && (x <= 2.4e+255))) {
tmp = t_0;
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): t_0 = y * math.sqrt((x * 9.0)) tmp = 0 if x <= 2.95e-95: tmp = math.sqrt((0.1111111111111111 / x)) elif x <= 1.1e-54: tmp = t_0 elif x <= 1.55e-27: tmp = 1.0 / (3.0 * math.sqrt(x)) elif (x <= 8.2e+84) or (not (x <= 2.1e+180) and (x <= 2.4e+255)): tmp = t_0 else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) t_0 = Float64(y * sqrt(Float64(x * 9.0))) tmp = 0.0 if (x <= 2.95e-95) tmp = sqrt(Float64(0.1111111111111111 / x)); elseif (x <= 1.1e-54) tmp = t_0; elseif (x <= 1.55e-27) tmp = Float64(1.0 / Float64(3.0 * sqrt(x))); elseif ((x <= 8.2e+84) || (!(x <= 2.1e+180) && (x <= 2.4e+255))) tmp = t_0; else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) t_0 = y * sqrt((x * 9.0)); tmp = 0.0; if (x <= 2.95e-95) tmp = sqrt((0.1111111111111111 / x)); elseif (x <= 1.1e-54) tmp = t_0; elseif (x <= 1.55e-27) tmp = 1.0 / (3.0 * sqrt(x)); elseif ((x <= 8.2e+84) || (~((x <= 2.1e+180)) && (x <= 2.4e+255))) tmp = t_0; else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2.95e-95], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1.1e-54], t$95$0, If[LessEqual[x, 1.55e-27], N[(1.0 / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 8.2e+84], And[N[Not[LessEqual[x, 2.1e+180]], $MachinePrecision], LessEqual[x, 2.4e+255]]], t$95$0, N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \sqrt{x \cdot 9}\\
\mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-54}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-27}:\\
\;\;\;\;\frac{1}{3 \cdot \sqrt{x}}\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{+84} \lor \neg \left(x \leq 2.1 \cdot 10^{+180}\right) \land x \leq 2.4 \cdot 10^{+255}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 2.9499999999999999e-95Initial program 99.2%
sub-neg99.2%
+-commutative99.2%
associate-+l+99.2%
*-commutative99.2%
associate-/r*99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
add-sqr-sqrt92.2%
sqrt-unprod89.2%
*-commutative89.2%
*-commutative89.2%
swap-sqr23.3%
pow223.3%
+-commutative23.3%
associate-+l+23.3%
swap-sqr23.3%
metadata-eval23.3%
add-sqr-sqrt23.4%
*-commutative23.4%
Applied egg-rr23.4%
Taylor expanded in x around 0 83.3%
if 2.9499999999999999e-95 < x < 1.1e-54 or 1.5499999999999999e-27 < x < 8.2000000000000006e84 or 2.1e180 < x < 2.40000000000000006e255Initial program 99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 62.8%
*-commutative62.8%
*-commutative62.8%
associate-*r*62.8%
rem-square-sqrt62.8%
rem-sqrt-square62.8%
metadata-eval62.8%
fabs-mul62.8%
rem-sqrt-square62.8%
swap-sqr62.8%
rem-square-sqrt62.9%
metadata-eval62.9%
Simplified62.9%
if 1.1e-54 < x < 1.5499999999999999e-27Initial program 99.0%
*-commutative99.0%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 76.6%
metadata-eval76.6%
sqrt-prod76.6%
div-inv76.6%
clear-num76.6%
sqrt-div76.8%
metadata-eval76.8%
div-inv76.8%
metadata-eval76.8%
sqrt-prod76.8%
metadata-eval76.8%
Applied egg-rr76.8%
if 8.2000000000000006e84 < x < 2.1e180 or 2.40000000000000006e255 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.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%
Taylor expanded in y around inf 75.6%
*-commutative75.6%
distribute-rgt-out75.7%
sub-neg75.7%
associate-*r/75.7%
metadata-eval75.7%
metadata-eval75.7%
+-commutative75.7%
Simplified75.7%
Taylor expanded in x around inf 99.2%
associate-*r/99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 64.1%
*-commutative64.1%
Simplified64.1%
Final simplification70.8%
(FPCore (x y)
:precision binary64
(if (<= x 2.95e-95)
(sqrt (/ 0.1111111111111111 x))
(if (<= x 4.5e-55)
(* y (sqrt (* x 9.0)))
(if (<= x 2.2e-29)
(/ 1.0 (* 3.0 (sqrt x)))
(* 3.0 (* (sqrt x) (+ y -1.0)))))))
double code(double x, double y) {
double tmp;
if (x <= 2.95e-95) {
tmp = sqrt((0.1111111111111111 / x));
} else if (x <= 4.5e-55) {
tmp = y * sqrt((x * 9.0));
} else if (x <= 2.2e-29) {
tmp = 1.0 / (3.0 * sqrt(x));
} else {
tmp = 3.0 * (sqrt(x) * (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.95d-95) then
tmp = sqrt((0.1111111111111111d0 / x))
else if (x <= 4.5d-55) then
tmp = y * sqrt((x * 9.0d0))
else if (x <= 2.2d-29) then
tmp = 1.0d0 / (3.0d0 * sqrt(x))
else
tmp = 3.0d0 * (sqrt(x) * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 2.95e-95) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else if (x <= 4.5e-55) {
tmp = y * Math.sqrt((x * 9.0));
} else if (x <= 2.2e-29) {
tmp = 1.0 / (3.0 * Math.sqrt(x));
} else {
tmp = 3.0 * (Math.sqrt(x) * (y + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 2.95e-95: tmp = math.sqrt((0.1111111111111111 / x)) elif x <= 4.5e-55: tmp = y * math.sqrt((x * 9.0)) elif x <= 2.2e-29: tmp = 1.0 / (3.0 * math.sqrt(x)) else: tmp = 3.0 * (math.sqrt(x) * (y + -1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 2.95e-95) tmp = sqrt(Float64(0.1111111111111111 / x)); elseif (x <= 4.5e-55) tmp = Float64(y * sqrt(Float64(x * 9.0))); elseif (x <= 2.2e-29) tmp = Float64(1.0 / Float64(3.0 * sqrt(x))); else tmp = Float64(3.0 * Float64(sqrt(x) * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 2.95e-95) tmp = sqrt((0.1111111111111111 / x)); elseif (x <= 4.5e-55) tmp = y * sqrt((x * 9.0)); elseif (x <= 2.2e-29) tmp = 1.0 / (3.0 * sqrt(x)); else tmp = 3.0 * (sqrt(x) * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 2.95e-95], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 4.5e-55], N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.2e-29], N[(1.0 / N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.95 \cdot 10^{-95}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-55}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-29}:\\
\;\;\;\;\frac{1}{3 \cdot \sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if x < 2.9499999999999999e-95Initial program 99.2%
sub-neg99.2%
+-commutative99.2%
associate-+l+99.2%
*-commutative99.2%
associate-/r*99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
add-sqr-sqrt92.2%
sqrt-unprod89.2%
*-commutative89.2%
*-commutative89.2%
swap-sqr23.3%
pow223.3%
+-commutative23.3%
associate-+l+23.3%
swap-sqr23.3%
metadata-eval23.3%
add-sqr-sqrt23.4%
*-commutative23.4%
Applied egg-rr23.4%
Taylor expanded in x around 0 83.3%
if 2.9499999999999999e-95 < x < 4.4999999999999997e-55Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
associate-+l+99.1%
*-commutative99.1%
associate-/r*99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
*-commutative99.2%
metadata-eval99.2%
sqrt-prod99.5%
Applied egg-rr99.5%
Taylor expanded in y around inf 62.8%
*-commutative62.8%
*-commutative62.8%
associate-*r*62.7%
rem-square-sqrt62.7%
rem-sqrt-square62.7%
metadata-eval62.7%
fabs-mul62.7%
rem-sqrt-square62.7%
swap-sqr62.9%
rem-square-sqrt63.0%
metadata-eval63.0%
Simplified63.0%
if 4.4999999999999997e-55 < x < 2.1999999999999999e-29Initial program 99.0%
*-commutative99.0%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 76.6%
metadata-eval76.6%
sqrt-prod76.6%
div-inv76.6%
clear-num76.6%
sqrt-div76.8%
metadata-eval76.8%
div-inv76.8%
metadata-eval76.8%
sqrt-prod76.8%
metadata-eval76.8%
Applied egg-rr76.8%
if 2.1999999999999999e-29 < x Initial program 99.5%
sub-neg99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 95.5%
Final simplification87.9%
(FPCore (x y) :precision binary64 (if (or (<= y -1.2) (not (<= y 1.7e-25))) (* y (* (sqrt x) (+ 3.0 (/ (/ 0.3333333333333333 x) y)))) (* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))))
double code(double x, double y) {
double tmp;
if ((y <= -1.2) || !(y <= 1.7e-25)) {
tmp = y * (sqrt(x) * (3.0 + ((0.3333333333333333 / x) / y)));
} else {
tmp = sqrt(x) * ((0.3333333333333333 / 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 ((y <= (-1.2d0)) .or. (.not. (y <= 1.7d-25))) then
tmp = y * (sqrt(x) * (3.0d0 + ((0.3333333333333333d0 / x) / y)))
else
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.2) || !(y <= 1.7e-25)) {
tmp = y * (Math.sqrt(x) * (3.0 + ((0.3333333333333333 / x) / y)));
} else {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.2) or not (y <= 1.7e-25): tmp = y * (math.sqrt(x) * (3.0 + ((0.3333333333333333 / x) / y))) else: tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.2) || !(y <= 1.7e-25)) tmp = Float64(y * Float64(sqrt(x) * Float64(3.0 + Float64(Float64(0.3333333333333333 / x) / y)))); else tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.2) || ~((y <= 1.7e-25))) tmp = y * (sqrt(x) * (3.0 + ((0.3333333333333333 / x) / y))); else tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.2], N[Not[LessEqual[y, 1.7e-25]], $MachinePrecision]], N[(y * N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 + N[(N[(0.3333333333333333 / x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \lor \neg \left(y \leq 1.7 \cdot 10^{-25}\right):\\
\;\;\;\;y \cdot \left(\sqrt{x} \cdot \left(3 + \frac{\frac{0.3333333333333333}{x}}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\
\end{array}
\end{array}
if y < -1.19999999999999996 or 1.70000000000000001e-25 < y Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 99.4%
*-commutative99.4%
distribute-rgt-out99.4%
sub-neg99.4%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in x around 0 99.0%
associate-/r*99.0%
Simplified99.0%
if -1.19999999999999996 < y < 1.70000000000000001e-25Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 98.2%
sub-neg98.2%
associate-*r/98.9%
metadata-eval98.9%
metadata-eval98.9%
+-commutative98.9%
Simplified98.9%
Final simplification98.9%
(FPCore (x y)
:precision binary64
(if (<= y -1.55e+22)
(* y (sqrt (* x 9.0)))
(if (<= y 82000000.0)
(* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))
(* y (* (sqrt x) (- 3.0 (/ 3.0 y)))))))
double code(double x, double y) {
double tmp;
if (y <= -1.55e+22) {
tmp = y * sqrt((x * 9.0));
} else if (y <= 82000000.0) {
tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = y * (sqrt(x) * (3.0 - (3.0 / y)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.55d+22)) then
tmp = y * sqrt((x * 9.0d0))
else if (y <= 82000000.0d0) then
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
else
tmp = y * (sqrt(x) * (3.0d0 - (3.0d0 / y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.55e+22) {
tmp = y * Math.sqrt((x * 9.0));
} else if (y <= 82000000.0) {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = y * (Math.sqrt(x) * (3.0 - (3.0 / y)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.55e+22: tmp = y * math.sqrt((x * 9.0)) elif y <= 82000000.0: tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0) else: tmp = y * (math.sqrt(x) * (3.0 - (3.0 / y))) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.55e+22) tmp = Float64(y * sqrt(Float64(x * 9.0))); elseif (y <= 82000000.0) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0)); else tmp = Float64(y * Float64(sqrt(x) * Float64(3.0 - Float64(3.0 / y)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.55e+22) tmp = y * sqrt((x * 9.0)); elseif (y <= 82000000.0) tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0); else tmp = y * (sqrt(x) * (3.0 - (3.0 / y))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.55e+22], N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 82000000.0], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 - N[(3.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+22}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\
\mathbf{elif}\;y \leq 82000000:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\sqrt{x} \cdot \left(3 - \frac{3}{y}\right)\right)\\
\end{array}
\end{array}
if y < -1.5500000000000001e22Initial program 99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 82.0%
*-commutative82.0%
*-commutative82.0%
associate-*r*81.9%
rem-square-sqrt81.9%
rem-sqrt-square81.9%
metadata-eval81.9%
fabs-mul81.9%
rem-sqrt-square81.9%
swap-sqr81.9%
rem-square-sqrt82.1%
metadata-eval82.1%
Simplified82.1%
if -1.5500000000000001e22 < y < 8.2e7Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 97.4%
sub-neg97.4%
associate-*r/98.1%
metadata-eval98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified98.1%
if 8.2e7 < y Initial program 99.3%
*-commutative99.3%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 99.4%
*-commutative99.4%
distribute-rgt-out99.5%
sub-neg99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in x around inf 76.6%
associate-*r/76.6%
metadata-eval76.6%
Simplified76.6%
Final simplification88.8%
(FPCore (x y)
:precision binary64
(if (<= y -2.7e+21)
(* y (sqrt (* x 9.0)))
(if (<= y 15200.0)
(* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))
(* 3.0 (* (sqrt x) (+ y -1.0))))))
double code(double x, double y) {
double tmp;
if (y <= -2.7e+21) {
tmp = y * sqrt((x * 9.0));
} else if (y <= 15200.0) {
tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = 3.0 * (sqrt(x) * (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 (y <= (-2.7d+21)) then
tmp = y * sqrt((x * 9.0d0))
else if (y <= 15200.0d0) then
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
else
tmp = 3.0d0 * (sqrt(x) * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2.7e+21) {
tmp = y * Math.sqrt((x * 9.0));
} else if (y <= 15200.0) {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = 3.0 * (Math.sqrt(x) * (y + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.7e+21: tmp = y * math.sqrt((x * 9.0)) elif y <= 15200.0: tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0) else: tmp = 3.0 * (math.sqrt(x) * (y + -1.0)) return tmp
function code(x, y) tmp = 0.0 if (y <= -2.7e+21) tmp = Float64(y * sqrt(Float64(x * 9.0))); elseif (y <= 15200.0) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0)); else tmp = Float64(3.0 * Float64(sqrt(x) * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.7e+21) tmp = y * sqrt((x * 9.0)); elseif (y <= 15200.0) tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0); else tmp = 3.0 * (sqrt(x) * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.7e+21], N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 15200.0], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+21}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\
\mathbf{elif}\;y \leq 15200:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if y < -2.7e21Initial program 99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 82.0%
*-commutative82.0%
*-commutative82.0%
associate-*r*81.9%
rem-square-sqrt81.9%
rem-sqrt-square81.9%
metadata-eval81.9%
fabs-mul81.9%
rem-sqrt-square81.9%
swap-sqr81.9%
rem-square-sqrt82.1%
metadata-eval82.1%
Simplified82.1%
if -2.7e21 < y < 15200Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 97.4%
sub-neg97.4%
associate-*r/98.1%
metadata-eval98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified98.1%
if 15200 < y Initial program 99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 76.5%
Final simplification88.8%
(FPCore (x y)
:precision binary64
(if (<= y -2.3e+18)
(* y (sqrt (* x 9.0)))
(if (<= y 75000000.0)
(* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))
(* (* 3.0 (sqrt x)) (+ y -1.0)))))
double code(double x, double y) {
double tmp;
if (y <= -2.3e+18) {
tmp = y * sqrt((x * 9.0));
} else if (y <= 75000000.0) {
tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = (3.0 * sqrt(x)) * (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 (y <= (-2.3d+18)) then
tmp = y * sqrt((x * 9.0d0))
else if (y <= 75000000.0d0) then
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
else
tmp = (3.0d0 * sqrt(x)) * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2.3e+18) {
tmp = y * Math.sqrt((x * 9.0));
} else if (y <= 75000000.0) {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = (3.0 * Math.sqrt(x)) * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.3e+18: tmp = y * math.sqrt((x * 9.0)) elif y <= 75000000.0: tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0) else: tmp = (3.0 * math.sqrt(x)) * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= -2.3e+18) tmp = Float64(y * sqrt(Float64(x * 9.0))); elseif (y <= 75000000.0) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0)); else tmp = Float64(Float64(3.0 * sqrt(x)) * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.3e+18) tmp = y * sqrt((x * 9.0)); elseif (y <= 75000000.0) tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0); else tmp = (3.0 * sqrt(x)) * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.3e+18], N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 75000000.0], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+18}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\
\mathbf{elif}\;y \leq 75000000:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(3 \cdot \sqrt{x}\right) \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if y < -2.3e18Initial program 99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 82.0%
*-commutative82.0%
*-commutative82.0%
associate-*r*81.9%
rem-square-sqrt81.9%
rem-sqrt-square81.9%
metadata-eval81.9%
fabs-mul81.9%
rem-sqrt-square81.9%
swap-sqr81.9%
rem-square-sqrt82.1%
metadata-eval82.1%
Simplified82.1%
if -2.3e18 < y < 7.5e7Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 97.4%
sub-neg97.4%
associate-*r/98.1%
metadata-eval98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified98.1%
if 7.5e7 < y Initial program 99.3%
Taylor expanded in y around inf 76.6%
Final simplification88.8%
(FPCore (x y) :precision binary64 (* (+ (/ 0.1111111111111111 x) (+ y -1.0)) (sqrt (* x 9.0))))
double code(double x, double y) {
return ((0.1111111111111111 / x) + (y + -1.0)) * sqrt((x * 9.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((0.1111111111111111d0 / x) + (y + (-1.0d0))) * sqrt((x * 9.0d0))
end function
public static double code(double x, double y) {
return ((0.1111111111111111 / x) + (y + -1.0)) * Math.sqrt((x * 9.0));
}
def code(x, y): return ((0.1111111111111111 / x) + (y + -1.0)) * math.sqrt((x * 9.0))
function code(x, y) return Float64(Float64(Float64(0.1111111111111111 / x) + Float64(y + -1.0)) * sqrt(Float64(x * 9.0))) end
function tmp = code(x, y) tmp = ((0.1111111111111111 / x) + (y + -1.0)) * sqrt((x * 9.0)); end
code[x_, y_] := N[(N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right) \cdot \sqrt{x \cdot 9}
\end{array}
Initial program 99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
*-commutative99.3%
metadata-eval99.3%
sqrt-prod99.2%
Applied egg-rr99.2%
Final simplification99.2%
(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(Float64(3.0 * 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[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(3 \cdot \sqrt{x}\right) \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)
\end{array}
Initial program 99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Final simplification99.3%
(FPCore (x y) :precision binary64 (if (<= x 0.11) (sqrt (/ 0.1111111111111111 x)) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if (x <= 0.11) {
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.11d0) 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.11) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.11: 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.11) 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.11) tmp = sqrt((0.1111111111111111 / x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.11], 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.11:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 0.110000000000000001Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
associate-+l+99.1%
*-commutative99.1%
associate-/r*99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
add-sqr-sqrt89.1%
sqrt-unprod80.8%
*-commutative80.8%
*-commutative80.8%
swap-sqr35.1%
pow235.1%
+-commutative35.1%
associate-+l+35.1%
swap-sqr35.1%
metadata-eval35.1%
add-sqr-sqrt35.2%
*-commutative35.2%
Applied egg-rr35.2%
Taylor expanded in x around 0 71.2%
if 0.110000000000000001 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.6%
associate--l+99.6%
distribute-lft-in99.6%
fma-define99.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%
Taylor expanded in y around inf 88.0%
*-commutative88.0%
distribute-rgt-out88.1%
sub-neg88.1%
associate-*r/88.1%
metadata-eval88.1%
metadata-eval88.1%
+-commutative88.1%
Simplified88.1%
Taylor expanded in x around inf 98.2%
associate-*r/98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in y around 0 47.7%
*-commutative47.7%
Simplified47.7%
Final simplification59.7%
(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.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 79.6%
*-commutative79.6%
distribute-rgt-out79.7%
sub-neg79.7%
associate-*r/79.7%
metadata-eval79.7%
metadata-eval79.7%
+-commutative79.7%
Simplified79.7%
Taylor expanded in x around inf 62.0%
associate-*r/62.1%
metadata-eval62.1%
Simplified62.1%
Taylor expanded in y around 0 24.2%
*-commutative24.2%
Simplified24.2%
pow124.2%
add-sqr-sqrt0.0%
sqrt-unprod3.3%
swap-sqr3.3%
add-sqr-sqrt3.3%
metadata-eval3.3%
Applied egg-rr3.3%
unpow13.3%
Simplified3.3%
Final simplification3.3%
(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.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
add-sqr-sqrt57.6%
sqrt-unprod47.6%
*-commutative47.6%
*-commutative47.6%
swap-sqr24.2%
pow224.2%
+-commutative24.2%
associate-+l+24.2%
swap-sqr24.2%
metadata-eval24.2%
add-sqr-sqrt24.2%
*-commutative24.2%
Applied egg-rr24.2%
Taylor expanded in x around 0 37.3%
Final simplification37.3%
(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 2024073
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:alt
(* 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)))