
(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 12 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 (* (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.4%
+-commutative99.4%
associate--l+99.4%
distribute-rgt-in99.4%
remove-double-neg99.4%
distribute-lft-neg-in99.4%
distribute-rgt-neg-in99.4%
mul-1-neg99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
distribute-neg-frac99.4%
*-commutative99.4%
associate-/r/99.4%
associate-/l/99.4%
associate-/r/99.4%
Simplified99.4%
add-sqr-sqrt48.3%
pow248.3%
Applied egg-rr48.3%
Taylor expanded in y around 0 98.6%
associate-*l*98.5%
associate-*l*98.5%
distribute-rgt-out98.6%
unpow298.6%
rem-square-sqrt99.4%
sub-neg99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
associate-*l*99.5%
+-commutative99.5%
metadata-eval99.5%
sub-neg99.5%
associate-+l-99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 3.0 (* (sqrt x) y)))
(t_1 (* (sqrt x) -3.0))
(t_2 (* (sqrt x) (/ 0.3333333333333333 x))))
(if (<= y -1.36e+84)
t_0
(if (<= y -2.1e+58)
t_2
(if (<= y -0.07)
t_0
(if (<= y -3.3e-285)
t_1
(if (<= y 8.2e-204) t_2 (if (<= y 7.2e-7) t_1 t_0))))))))
double code(double x, double y) {
double t_0 = 3.0 * (sqrt(x) * y);
double t_1 = sqrt(x) * -3.0;
double t_2 = sqrt(x) * (0.3333333333333333 / x);
double tmp;
if (y <= -1.36e+84) {
tmp = t_0;
} else if (y <= -2.1e+58) {
tmp = t_2;
} else if (y <= -0.07) {
tmp = t_0;
} else if (y <= -3.3e-285) {
tmp = t_1;
} else if (y <= 8.2e-204) {
tmp = t_2;
} else if (y <= 7.2e-7) {
tmp = t_1;
} else {
tmp = t_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) :: t_2
real(8) :: tmp
t_0 = 3.0d0 * (sqrt(x) * y)
t_1 = sqrt(x) * (-3.0d0)
t_2 = sqrt(x) * (0.3333333333333333d0 / x)
if (y <= (-1.36d+84)) then
tmp = t_0
else if (y <= (-2.1d+58)) then
tmp = t_2
else if (y <= (-0.07d0)) then
tmp = t_0
else if (y <= (-3.3d-285)) then
tmp = t_1
else if (y <= 8.2d-204) then
tmp = t_2
else if (y <= 7.2d-7) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 3.0 * (Math.sqrt(x) * y);
double t_1 = Math.sqrt(x) * -3.0;
double t_2 = Math.sqrt(x) * (0.3333333333333333 / x);
double tmp;
if (y <= -1.36e+84) {
tmp = t_0;
} else if (y <= -2.1e+58) {
tmp = t_2;
} else if (y <= -0.07) {
tmp = t_0;
} else if (y <= -3.3e-285) {
tmp = t_1;
} else if (y <= 8.2e-204) {
tmp = t_2;
} else if (y <= 7.2e-7) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 3.0 * (math.sqrt(x) * y) t_1 = math.sqrt(x) * -3.0 t_2 = math.sqrt(x) * (0.3333333333333333 / x) tmp = 0 if y <= -1.36e+84: tmp = t_0 elif y <= -2.1e+58: tmp = t_2 elif y <= -0.07: tmp = t_0 elif y <= -3.3e-285: tmp = t_1 elif y <= 8.2e-204: tmp = t_2 elif y <= 7.2e-7: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(3.0 * Float64(sqrt(x) * y)) t_1 = Float64(sqrt(x) * -3.0) t_2 = Float64(sqrt(x) * Float64(0.3333333333333333 / x)) tmp = 0.0 if (y <= -1.36e+84) tmp = t_0; elseif (y <= -2.1e+58) tmp = t_2; elseif (y <= -0.07) tmp = t_0; elseif (y <= -3.3e-285) tmp = t_1; elseif (y <= 8.2e-204) tmp = t_2; elseif (y <= 7.2e-7) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 3.0 * (sqrt(x) * y); t_1 = sqrt(x) * -3.0; t_2 = sqrt(x) * (0.3333333333333333 / x); tmp = 0.0; if (y <= -1.36e+84) tmp = t_0; elseif (y <= -2.1e+58) tmp = t_2; elseif (y <= -0.07) tmp = t_0; elseif (y <= -3.3e-285) tmp = t_1; elseif (y <= 8.2e-204) tmp = t_2; elseif (y <= 7.2e-7) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[x], $MachinePrecision] * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.36e+84], t$95$0, If[LessEqual[y, -2.1e+58], t$95$2, If[LessEqual[y, -0.07], t$95$0, If[LessEqual[y, -3.3e-285], t$95$1, If[LessEqual[y, 8.2e-204], t$95$2, If[LessEqual[y, 7.2e-7], t$95$1, t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(\sqrt{x} \cdot y\right)\\
t_1 := \sqrt{x} \cdot -3\\
t_2 := \sqrt{x} \cdot \frac{0.3333333333333333}{x}\\
\mathbf{if}\;y \leq -1.36 \cdot 10^{+84}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{+58}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -0.07:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-285}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-204}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.3599999999999999e84 or -2.10000000000000012e58 < y < -0.070000000000000007 or 7.19999999999999989e-7 < y Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
distribute-rgt-in99.4%
+-commutative99.4%
fma-def99.5%
remove-double-neg99.5%
fma-neg99.4%
associate-*r*99.4%
*-commutative99.4%
associate-*r*99.4%
distribute-rgt-neg-in99.4%
*-commutative99.4%
associate-/r*99.4%
associate-/r/99.4%
mul-1-neg99.4%
metadata-eval99.4%
Simplified99.5%
Taylor expanded in y around inf 77.2%
if -1.3599999999999999e84 < y < -2.10000000000000012e58 or -3.29999999999999985e-285 < y < 8.2000000000000002e-204Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
distribute-rgt-in99.4%
+-commutative99.4%
fma-def99.4%
remove-double-neg99.4%
fma-neg99.4%
associate-*r*99.4%
*-commutative99.4%
associate-*r*99.3%
distribute-rgt-neg-in99.3%
*-commutative99.3%
associate-/r*99.2%
associate-/r/99.3%
mul-1-neg99.3%
metadata-eval99.3%
Simplified99.4%
Taylor expanded in x around 0 65.0%
if -0.070000000000000007 < y < -3.29999999999999985e-285 or 8.2000000000000002e-204 < y < 7.19999999999999989e-7Initial program 99.4%
Taylor expanded in y around inf 62.1%
Taylor expanded in y around 0 61.7%
*-commutative61.7%
Simplified61.7%
Final simplification70.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 3.0 (* (sqrt x) y)))
(t_1 (* (sqrt x) -3.0))
(t_2 (* (sqrt x) (/ 0.3333333333333333 x))))
(if (<= y -1.55e+84)
t_0
(if (<= y -1.52e+57)
t_2
(if (<= y -0.07)
t_0
(if (<= y -1.55e-279)
t_1
(if (<= y 1.46e-204)
t_2
(if (<= y 7.2e-7) t_1 (* y (* 3.0 (sqrt x)))))))))))
double code(double x, double y) {
double t_0 = 3.0 * (sqrt(x) * y);
double t_1 = sqrt(x) * -3.0;
double t_2 = sqrt(x) * (0.3333333333333333 / x);
double tmp;
if (y <= -1.55e+84) {
tmp = t_0;
} else if (y <= -1.52e+57) {
tmp = t_2;
} else if (y <= -0.07) {
tmp = t_0;
} else if (y <= -1.55e-279) {
tmp = t_1;
} else if (y <= 1.46e-204) {
tmp = t_2;
} else if (y <= 7.2e-7) {
tmp = t_1;
} else {
tmp = y * (3.0 * sqrt(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) :: t_2
real(8) :: tmp
t_0 = 3.0d0 * (sqrt(x) * y)
t_1 = sqrt(x) * (-3.0d0)
t_2 = sqrt(x) * (0.3333333333333333d0 / x)
if (y <= (-1.55d+84)) then
tmp = t_0
else if (y <= (-1.52d+57)) then
tmp = t_2
else if (y <= (-0.07d0)) then
tmp = t_0
else if (y <= (-1.55d-279)) then
tmp = t_1
else if (y <= 1.46d-204) then
tmp = t_2
else if (y <= 7.2d-7) then
tmp = t_1
else
tmp = y * (3.0d0 * sqrt(x))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 3.0 * (Math.sqrt(x) * y);
double t_1 = Math.sqrt(x) * -3.0;
double t_2 = Math.sqrt(x) * (0.3333333333333333 / x);
double tmp;
if (y <= -1.55e+84) {
tmp = t_0;
} else if (y <= -1.52e+57) {
tmp = t_2;
} else if (y <= -0.07) {
tmp = t_0;
} else if (y <= -1.55e-279) {
tmp = t_1;
} else if (y <= 1.46e-204) {
tmp = t_2;
} else if (y <= 7.2e-7) {
tmp = t_1;
} else {
tmp = y * (3.0 * Math.sqrt(x));
}
return tmp;
}
def code(x, y): t_0 = 3.0 * (math.sqrt(x) * y) t_1 = math.sqrt(x) * -3.0 t_2 = math.sqrt(x) * (0.3333333333333333 / x) tmp = 0 if y <= -1.55e+84: tmp = t_0 elif y <= -1.52e+57: tmp = t_2 elif y <= -0.07: tmp = t_0 elif y <= -1.55e-279: tmp = t_1 elif y <= 1.46e-204: tmp = t_2 elif y <= 7.2e-7: tmp = t_1 else: tmp = y * (3.0 * math.sqrt(x)) return tmp
function code(x, y) t_0 = Float64(3.0 * Float64(sqrt(x) * y)) t_1 = Float64(sqrt(x) * -3.0) t_2 = Float64(sqrt(x) * Float64(0.3333333333333333 / x)) tmp = 0.0 if (y <= -1.55e+84) tmp = t_0; elseif (y <= -1.52e+57) tmp = t_2; elseif (y <= -0.07) tmp = t_0; elseif (y <= -1.55e-279) tmp = t_1; elseif (y <= 1.46e-204) tmp = t_2; elseif (y <= 7.2e-7) tmp = t_1; else tmp = Float64(y * Float64(3.0 * sqrt(x))); end return tmp end
function tmp_2 = code(x, y) t_0 = 3.0 * (sqrt(x) * y); t_1 = sqrt(x) * -3.0; t_2 = sqrt(x) * (0.3333333333333333 / x); tmp = 0.0; if (y <= -1.55e+84) tmp = t_0; elseif (y <= -1.52e+57) tmp = t_2; elseif (y <= -0.07) tmp = t_0; elseif (y <= -1.55e-279) tmp = t_1; elseif (y <= 1.46e-204) tmp = t_2; elseif (y <= 7.2e-7) tmp = t_1; else tmp = y * (3.0 * sqrt(x)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[x], $MachinePrecision] * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.55e+84], t$95$0, If[LessEqual[y, -1.52e+57], t$95$2, If[LessEqual[y, -0.07], t$95$0, If[LessEqual[y, -1.55e-279], t$95$1, If[LessEqual[y, 1.46e-204], t$95$2, If[LessEqual[y, 7.2e-7], t$95$1, N[(y * N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(\sqrt{x} \cdot y\right)\\
t_1 := \sqrt{x} \cdot -3\\
t_2 := \sqrt{x} \cdot \frac{0.3333333333333333}{x}\\
\mathbf{if}\;y \leq -1.55 \cdot 10^{+84}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.52 \cdot 10^{+57}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -0.07:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{-279}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.46 \cdot 10^{-204}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(3 \cdot \sqrt{x}\right)\\
\end{array}
\end{array}
if y < -1.55000000000000001e84 or -1.51999999999999998e57 < y < -0.070000000000000007Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
distribute-rgt-in99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
fma-neg99.5%
associate-*r*99.4%
*-commutative99.4%
associate-*r*99.4%
distribute-rgt-neg-in99.4%
*-commutative99.4%
associate-/r*99.4%
associate-/r/99.4%
mul-1-neg99.4%
metadata-eval99.4%
Simplified99.5%
Taylor expanded in y around inf 77.8%
if -1.55000000000000001e84 < y < -1.51999999999999998e57 or -1.55e-279 < y < 1.45999999999999998e-204Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
distribute-rgt-in99.4%
+-commutative99.4%
fma-def99.4%
remove-double-neg99.4%
fma-neg99.4%
associate-*r*99.4%
*-commutative99.4%
associate-*r*99.3%
distribute-rgt-neg-in99.3%
*-commutative99.3%
associate-/r*99.2%
associate-/r/99.3%
mul-1-neg99.3%
metadata-eval99.3%
Simplified99.4%
Taylor expanded in x around 0 65.0%
if -0.070000000000000007 < y < -1.55e-279 or 1.45999999999999998e-204 < y < 7.19999999999999989e-7Initial program 99.4%
Taylor expanded in y around inf 62.1%
Taylor expanded in y around 0 61.7%
*-commutative61.7%
Simplified61.7%
if 7.19999999999999989e-7 < y Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
distribute-rgt-in99.4%
+-commutative99.4%
fma-def99.5%
remove-double-neg99.5%
fma-neg99.4%
associate-*r*99.4%
*-commutative99.4%
associate-*r*99.3%
distribute-rgt-neg-in99.3%
*-commutative99.3%
associate-/r*99.3%
associate-/r/99.3%
mul-1-neg99.3%
metadata-eval99.3%
Simplified99.4%
Taylor expanded in y around inf 76.4%
add-sqr-sqrt76.2%
pow276.2%
*-commutative76.2%
Applied egg-rr76.2%
unpow276.2%
add-sqr-sqrt76.4%
associate-*r*76.4%
Applied egg-rr76.4%
Final simplification70.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 3.0 (* (sqrt x) y))))
(if (<= y -8.5e+83)
t_0
(if (<= y -2.1e+59)
(* (sqrt x) (/ 0.3333333333333333 x))
(if (<= y -6500000.0)
t_0
(if (<= y 2000000000.0)
(* (sqrt x) (+ -3.0 (/ 0.3333333333333333 x)))
(* y (* 3.0 (sqrt x)))))))))
double code(double x, double y) {
double t_0 = 3.0 * (sqrt(x) * y);
double tmp;
if (y <= -8.5e+83) {
tmp = t_0;
} else if (y <= -2.1e+59) {
tmp = sqrt(x) * (0.3333333333333333 / x);
} else if (y <= -6500000.0) {
tmp = t_0;
} else if (y <= 2000000000.0) {
tmp = sqrt(x) * (-3.0 + (0.3333333333333333 / x));
} else {
tmp = y * (3.0 * sqrt(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) :: tmp
t_0 = 3.0d0 * (sqrt(x) * y)
if (y <= (-8.5d+83)) then
tmp = t_0
else if (y <= (-2.1d+59)) then
tmp = sqrt(x) * (0.3333333333333333d0 / x)
else if (y <= (-6500000.0d0)) then
tmp = t_0
else if (y <= 2000000000.0d0) then
tmp = sqrt(x) * ((-3.0d0) + (0.3333333333333333d0 / x))
else
tmp = y * (3.0d0 * sqrt(x))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 3.0 * (Math.sqrt(x) * y);
double tmp;
if (y <= -8.5e+83) {
tmp = t_0;
} else if (y <= -2.1e+59) {
tmp = Math.sqrt(x) * (0.3333333333333333 / x);
} else if (y <= -6500000.0) {
tmp = t_0;
} else if (y <= 2000000000.0) {
tmp = Math.sqrt(x) * (-3.0 + (0.3333333333333333 / x));
} else {
tmp = y * (3.0 * Math.sqrt(x));
}
return tmp;
}
def code(x, y): t_0 = 3.0 * (math.sqrt(x) * y) tmp = 0 if y <= -8.5e+83: tmp = t_0 elif y <= -2.1e+59: tmp = math.sqrt(x) * (0.3333333333333333 / x) elif y <= -6500000.0: tmp = t_0 elif y <= 2000000000.0: tmp = math.sqrt(x) * (-3.0 + (0.3333333333333333 / x)) else: tmp = y * (3.0 * math.sqrt(x)) return tmp
function code(x, y) t_0 = Float64(3.0 * Float64(sqrt(x) * y)) tmp = 0.0 if (y <= -8.5e+83) tmp = t_0; elseif (y <= -2.1e+59) tmp = Float64(sqrt(x) * Float64(0.3333333333333333 / x)); elseif (y <= -6500000.0) tmp = t_0; elseif (y <= 2000000000.0) tmp = Float64(sqrt(x) * Float64(-3.0 + Float64(0.3333333333333333 / x))); else tmp = Float64(y * Float64(3.0 * sqrt(x))); end return tmp end
function tmp_2 = code(x, y) t_0 = 3.0 * (sqrt(x) * y); tmp = 0.0; if (y <= -8.5e+83) tmp = t_0; elseif (y <= -2.1e+59) tmp = sqrt(x) * (0.3333333333333333 / x); elseif (y <= -6500000.0) tmp = t_0; elseif (y <= 2000000000.0) tmp = sqrt(x) * (-3.0 + (0.3333333333333333 / x)); else tmp = y * (3.0 * sqrt(x)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.5e+83], t$95$0, If[LessEqual[y, -2.1e+59], N[(N[Sqrt[x], $MachinePrecision] * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6500000.0], t$95$0, If[LessEqual[y, 2000000000.0], N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(\sqrt{x} \cdot y\right)\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{+83}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{+59}:\\
\;\;\;\;\sqrt{x} \cdot \frac{0.3333333333333333}{x}\\
\mathbf{elif}\;y \leq -6500000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2000000000:\\
\;\;\;\;\sqrt{x} \cdot \left(-3 + \frac{0.3333333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(3 \cdot \sqrt{x}\right)\\
\end{array}
\end{array}
if y < -8.4999999999999995e83 or -2.09999999999999984e59 < y < -6.5e6Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
fma-neg99.5%
associate-*r*99.4%
*-commutative99.4%
associate-*r*99.4%
distribute-rgt-neg-in99.4%
*-commutative99.4%
associate-/r*99.4%
associate-/r/99.4%
mul-1-neg99.4%
metadata-eval99.4%
Simplified99.5%
Taylor expanded in y around inf 81.3%
if -8.4999999999999995e83 < y < -2.09999999999999984e59Initial program 99.1%
+-commutative99.1%
associate--l+99.1%
distribute-rgt-in99.1%
+-commutative99.1%
fma-def99.1%
remove-double-neg99.1%
fma-neg99.1%
associate-*r*99.3%
*-commutative99.3%
associate-*r*99.6%
distribute-rgt-neg-in99.6%
*-commutative99.6%
associate-/r*99.3%
associate-/r/98.9%
mul-1-neg98.9%
metadata-eval98.9%
Simplified99.3%
Taylor expanded in x around 0 85.5%
if -6.5e6 < y < 2e9Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
distribute-rgt-in99.4%
+-commutative99.4%
fma-def99.4%
remove-double-neg99.4%
fma-neg99.4%
associate-*r*99.4%
*-commutative99.4%
associate-*r*99.5%
distribute-rgt-neg-in99.5%
*-commutative99.5%
associate-/r*99.4%
associate-/r/99.4%
mul-1-neg99.4%
metadata-eval99.4%
Simplified99.5%
Taylor expanded in y around 0 97.7%
*-commutative97.7%
associate-*r/97.8%
metadata-eval97.8%
sub-neg97.8%
metadata-eval97.8%
Simplified97.8%
if 2e9 < y Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
distribute-rgt-in99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
fma-neg99.5%
associate-*r*99.4%
*-commutative99.4%
associate-*r*99.3%
distribute-rgt-neg-in99.3%
*-commutative99.3%
associate-/r*99.3%
associate-/r/99.3%
mul-1-neg99.3%
metadata-eval99.3%
Simplified99.4%
Taylor expanded in y around inf 79.0%
add-sqr-sqrt78.8%
pow278.8%
*-commutative78.8%
Applied egg-rr78.8%
unpow278.8%
add-sqr-sqrt79.0%
associate-*r*79.0%
Applied egg-rr79.0%
Final simplification88.7%
(FPCore (x y)
:precision binary64
(if (<= x 6e-131)
(* (sqrt x) (/ 0.3333333333333333 x))
(if (<= x 1.15e-72)
(* y (* 3.0 (sqrt x)))
(if (<= x 1.05e-29)
(* 3.0 (* (sqrt x) (+ (/ 0.1111111111111111 x) -1.0)))
(* 3.0 (* (sqrt x) (+ y -1.0)))))))
double code(double x, double y) {
double tmp;
if (x <= 6e-131) {
tmp = sqrt(x) * (0.3333333333333333 / x);
} else if (x <= 1.15e-72) {
tmp = y * (3.0 * sqrt(x));
} else if (x <= 1.05e-29) {
tmp = 3.0 * (sqrt(x) * ((0.1111111111111111 / x) + -1.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 (x <= 6d-131) then
tmp = sqrt(x) * (0.3333333333333333d0 / x)
else if (x <= 1.15d-72) then
tmp = y * (3.0d0 * sqrt(x))
else if (x <= 1.05d-29) then
tmp = 3.0d0 * (sqrt(x) * ((0.1111111111111111d0 / x) + (-1.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 (x <= 6e-131) {
tmp = Math.sqrt(x) * (0.3333333333333333 / x);
} else if (x <= 1.15e-72) {
tmp = y * (3.0 * Math.sqrt(x));
} else if (x <= 1.05e-29) {
tmp = 3.0 * (Math.sqrt(x) * ((0.1111111111111111 / x) + -1.0));
} else {
tmp = 3.0 * (Math.sqrt(x) * (y + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 6e-131: tmp = math.sqrt(x) * (0.3333333333333333 / x) elif x <= 1.15e-72: tmp = y * (3.0 * math.sqrt(x)) elif x <= 1.05e-29: tmp = 3.0 * (math.sqrt(x) * ((0.1111111111111111 / x) + -1.0)) else: tmp = 3.0 * (math.sqrt(x) * (y + -1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 6e-131) tmp = Float64(sqrt(x) * Float64(0.3333333333333333 / x)); elseif (x <= 1.15e-72) tmp = Float64(y * Float64(3.0 * sqrt(x))); elseif (x <= 1.05e-29) tmp = Float64(3.0 * Float64(sqrt(x) * Float64(Float64(0.1111111111111111 / x) + -1.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 (x <= 6e-131) tmp = sqrt(x) * (0.3333333333333333 / x); elseif (x <= 1.15e-72) tmp = y * (3.0 * sqrt(x)); elseif (x <= 1.05e-29) tmp = 3.0 * (sqrt(x) * ((0.1111111111111111 / x) + -1.0)); else tmp = 3.0 * (sqrt(x) * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 6e-131], N[(N[Sqrt[x], $MachinePrecision] * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.15e-72], N[(y * N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.05e-29], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.1111111111111111 / x), $MachinePrecision] + -1.0), $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 6 \cdot 10^{-131}:\\
\;\;\;\;\sqrt{x} \cdot \frac{0.3333333333333333}{x}\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-72}:\\
\;\;\;\;y \cdot \left(3 \cdot \sqrt{x}\right)\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-29}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if x < 5.99999999999999992e-131Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
distribute-rgt-in99.3%
+-commutative99.3%
fma-def99.3%
remove-double-neg99.3%
fma-neg99.3%
associate-*r*99.3%
*-commutative99.3%
associate-*r*99.3%
distribute-rgt-neg-in99.3%
*-commutative99.3%
associate-/r*99.2%
associate-/r/99.1%
mul-1-neg99.1%
metadata-eval99.1%
Simplified99.3%
Taylor expanded in x around 0 84.5%
if 5.99999999999999992e-131 < x < 1.14999999999999997e-72Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
fma-neg99.6%
associate-*r*99.5%
*-commutative99.5%
associate-*r*99.3%
distribute-rgt-neg-in99.3%
*-commutative99.3%
associate-/r*99.5%
associate-/r/99.4%
mul-1-neg99.4%
metadata-eval99.4%
Simplified99.6%
Taylor expanded in y around inf 64.9%
add-sqr-sqrt29.3%
pow229.3%
*-commutative29.3%
Applied egg-rr29.3%
unpow229.3%
add-sqr-sqrt64.9%
associate-*r*65.1%
Applied egg-rr65.1%
if 1.14999999999999997e-72 < x < 1.04999999999999995e-29Initial program 98.7%
+-commutative98.7%
associate--l+98.7%
distribute-rgt-in98.7%
remove-double-neg98.7%
distribute-lft-neg-in98.7%
distribute-rgt-neg-in98.7%
mul-1-neg98.7%
metadata-eval98.7%
*-commutative98.7%
associate-/r*98.8%
distribute-neg-frac98.8%
*-commutative98.8%
associate-/r/99.0%
associate-/l/99.0%
associate-/r/98.8%
Simplified98.8%
add-sqr-sqrt83.7%
pow283.7%
Applied egg-rr83.7%
Taylor expanded in y around 0 98.3%
associate-*l*98.2%
associate-*l*98.2%
distribute-rgt-out98.2%
unpow298.2%
rem-square-sqrt98.9%
sub-neg98.9%
associate-*r/98.8%
metadata-eval98.8%
metadata-eval98.8%
associate-*l*99.4%
+-commutative99.4%
metadata-eval99.4%
sub-neg99.4%
associate-+l-99.4%
Simplified99.4%
Taylor expanded in y around 0 70.6%
*-commutative70.6%
sub-neg70.6%
associate-*r/70.6%
metadata-eval70.6%
metadata-eval70.6%
+-commutative70.6%
Simplified70.6%
if 1.04999999999999995e-29 < x Initial program 99.6%
Taylor expanded in y around inf 97.1%
add-cube-cbrt95.6%
pow395.6%
*-commutative95.6%
*-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
Applied egg-rr95.6%
rem-cube-cbrt97.1%
associate-*r*97.1%
*-commutative97.1%
Applied egg-rr97.1%
Final simplification88.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sqrt x) (+ -3.0 (/ 3.0 (* x 9.0))))))
(if (<= x 6.2e-131)
t_0
(if (<= x 1.15e-72)
(* y (* 3.0 (sqrt x)))
(if (<= x 1.35e-29) t_0 (* 3.0 (* (sqrt x) (+ y -1.0))))))))
double code(double x, double y) {
double t_0 = sqrt(x) * (-3.0 + (3.0 / (x * 9.0)));
double tmp;
if (x <= 6.2e-131) {
tmp = t_0;
} else if (x <= 1.15e-72) {
tmp = y * (3.0 * sqrt(x));
} else if (x <= 1.35e-29) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = sqrt(x) * ((-3.0d0) + (3.0d0 / (x * 9.0d0)))
if (x <= 6.2d-131) then
tmp = t_0
else if (x <= 1.15d-72) then
tmp = y * (3.0d0 * sqrt(x))
else if (x <= 1.35d-29) then
tmp = t_0
else
tmp = 3.0d0 * (sqrt(x) * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt(x) * (-3.0 + (3.0 / (x * 9.0)));
double tmp;
if (x <= 6.2e-131) {
tmp = t_0;
} else if (x <= 1.15e-72) {
tmp = y * (3.0 * Math.sqrt(x));
} else if (x <= 1.35e-29) {
tmp = t_0;
} else {
tmp = 3.0 * (Math.sqrt(x) * (y + -1.0));
}
return tmp;
}
def code(x, y): t_0 = math.sqrt(x) * (-3.0 + (3.0 / (x * 9.0))) tmp = 0 if x <= 6.2e-131: tmp = t_0 elif x <= 1.15e-72: tmp = y * (3.0 * math.sqrt(x)) elif x <= 1.35e-29: tmp = t_0 else: tmp = 3.0 * (math.sqrt(x) * (y + -1.0)) return tmp
function code(x, y) t_0 = Float64(sqrt(x) * Float64(-3.0 + Float64(3.0 / Float64(x * 9.0)))) tmp = 0.0 if (x <= 6.2e-131) tmp = t_0; elseif (x <= 1.15e-72) tmp = Float64(y * Float64(3.0 * sqrt(x))); elseif (x <= 1.35e-29) tmp = t_0; else tmp = Float64(3.0 * Float64(sqrt(x) * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt(x) * (-3.0 + (3.0 / (x * 9.0))); tmp = 0.0; if (x <= 6.2e-131) tmp = t_0; elseif (x <= 1.15e-72) tmp = y * (3.0 * sqrt(x)); elseif (x <= 1.35e-29) tmp = t_0; else tmp = 3.0 * (sqrt(x) * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 + N[(3.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 6.2e-131], t$95$0, If[LessEqual[x, 1.15e-72], N[(y * N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e-29], t$95$0, N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x} \cdot \left(-3 + \frac{3}{x \cdot 9}\right)\\
\mathbf{if}\;x \leq 6.2 \cdot 10^{-131}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-72}:\\
\;\;\;\;y \cdot \left(3 \cdot \sqrt{x}\right)\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-29}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if x < 6.20000000000000041e-131 or 1.14999999999999997e-72 < x < 1.35000000000000011e-29Initial program 99.1%
+-commutative99.1%
associate--l+99.1%
distribute-rgt-in99.1%
remove-double-neg99.1%
distribute-lft-neg-in99.1%
distribute-rgt-neg-in99.1%
mul-1-neg99.1%
metadata-eval99.1%
*-commutative99.1%
associate-/r*99.0%
distribute-neg-frac99.0%
*-commutative99.0%
associate-/r/99.1%
associate-/l/99.1%
associate-/r/99.0%
Simplified99.0%
add-sqr-sqrt88.5%
pow288.5%
Applied egg-rr88.5%
Taylor expanded in y around 0 80.3%
*-commutative80.3%
*-commutative80.3%
unpow280.3%
rem-square-sqrt81.2%
sub-neg81.2%
associate-*r/81.1%
metadata-eval81.1%
metadata-eval81.1%
+-commutative81.1%
distribute-rgt-in81.1%
metadata-eval81.1%
Simplified81.1%
*-commutative81.1%
clear-num81.1%
un-div-inv81.2%
div-inv81.4%
metadata-eval81.4%
Applied egg-rr81.4%
if 6.20000000000000041e-131 < x < 1.14999999999999997e-72Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
fma-neg99.6%
associate-*r*99.5%
*-commutative99.5%
associate-*r*99.3%
distribute-rgt-neg-in99.3%
*-commutative99.3%
associate-/r*99.5%
associate-/r/99.4%
mul-1-neg99.4%
metadata-eval99.4%
Simplified99.6%
Taylor expanded in y around inf 64.9%
add-sqr-sqrt29.3%
pow229.3%
*-commutative29.3%
Applied egg-rr29.3%
unpow229.3%
add-sqr-sqrt64.9%
associate-*r*65.1%
Applied egg-rr65.1%
if 1.35000000000000011e-29 < x Initial program 99.6%
Taylor expanded in y around inf 97.1%
add-cube-cbrt95.6%
pow395.6%
*-commutative95.6%
*-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
Applied egg-rr95.6%
rem-cube-cbrt97.1%
associate-*r*97.1%
*-commutative97.1%
Applied egg-rr97.1%
Final simplification88.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sqrt x) (/ 0.3333333333333333 x))))
(if (<= x 7.2e-131)
t_0
(if (<= x 1.05e-72)
(* y (* 3.0 (sqrt x)))
(if (<= x 7.5e-30) t_0 (* (sqrt x) (- (* 3.0 y) 3.0)))))))
double code(double x, double y) {
double t_0 = sqrt(x) * (0.3333333333333333 / x);
double tmp;
if (x <= 7.2e-131) {
tmp = t_0;
} else if (x <= 1.05e-72) {
tmp = y * (3.0 * sqrt(x));
} else if (x <= 7.5e-30) {
tmp = t_0;
} else {
tmp = sqrt(x) * ((3.0 * y) - 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 = sqrt(x) * (0.3333333333333333d0 / x)
if (x <= 7.2d-131) then
tmp = t_0
else if (x <= 1.05d-72) then
tmp = y * (3.0d0 * sqrt(x))
else if (x <= 7.5d-30) then
tmp = t_0
else
tmp = sqrt(x) * ((3.0d0 * y) - 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt(x) * (0.3333333333333333 / x);
double tmp;
if (x <= 7.2e-131) {
tmp = t_0;
} else if (x <= 1.05e-72) {
tmp = y * (3.0 * Math.sqrt(x));
} else if (x <= 7.5e-30) {
tmp = t_0;
} else {
tmp = Math.sqrt(x) * ((3.0 * y) - 3.0);
}
return tmp;
}
def code(x, y): t_0 = math.sqrt(x) * (0.3333333333333333 / x) tmp = 0 if x <= 7.2e-131: tmp = t_0 elif x <= 1.05e-72: tmp = y * (3.0 * math.sqrt(x)) elif x <= 7.5e-30: tmp = t_0 else: tmp = math.sqrt(x) * ((3.0 * y) - 3.0) return tmp
function code(x, y) t_0 = Float64(sqrt(x) * Float64(0.3333333333333333 / x)) tmp = 0.0 if (x <= 7.2e-131) tmp = t_0; elseif (x <= 1.05e-72) tmp = Float64(y * Float64(3.0 * sqrt(x))); elseif (x <= 7.5e-30) tmp = t_0; else tmp = Float64(sqrt(x) * Float64(Float64(3.0 * y) - 3.0)); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt(x) * (0.3333333333333333 / x); tmp = 0.0; if (x <= 7.2e-131) tmp = t_0; elseif (x <= 1.05e-72) tmp = y * (3.0 * sqrt(x)); elseif (x <= 7.5e-30) tmp = t_0; else tmp = sqrt(x) * ((3.0 * y) - 3.0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[x], $MachinePrecision] * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 7.2e-131], t$95$0, If[LessEqual[x, 1.05e-72], N[(y * N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e-30], t$95$0, N[(N[Sqrt[x], $MachinePrecision] * N[(N[(3.0 * y), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x} \cdot \frac{0.3333333333333333}{x}\\
\mathbf{if}\;x \leq 7.2 \cdot 10^{-131}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-72}:\\
\;\;\;\;y \cdot \left(3 \cdot \sqrt{x}\right)\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-30}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(3 \cdot y - 3\right)\\
\end{array}
\end{array}
if x < 7.1999999999999999e-131 or 1.05e-72 < x < 7.5000000000000006e-30Initial program 99.1%
+-commutative99.1%
associate--l+99.1%
distribute-rgt-in99.1%
+-commutative99.1%
fma-def99.2%
remove-double-neg99.2%
fma-neg99.1%
associate-*r*99.1%
*-commutative99.1%
associate-*r*99.2%
distribute-rgt-neg-in99.2%
*-commutative99.2%
associate-/r*99.1%
associate-/r/99.1%
mul-1-neg99.1%
metadata-eval99.1%
Simplified99.2%
Taylor expanded in x around 0 81.2%
if 7.1999999999999999e-131 < x < 1.05e-72Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
fma-neg99.6%
associate-*r*99.5%
*-commutative99.5%
associate-*r*99.3%
distribute-rgt-neg-in99.3%
*-commutative99.3%
associate-/r*99.5%
associate-/r/99.4%
mul-1-neg99.4%
metadata-eval99.4%
Simplified99.6%
Taylor expanded in y around inf 64.9%
add-sqr-sqrt29.3%
pow229.3%
*-commutative29.3%
Applied egg-rr29.3%
unpow229.3%
add-sqr-sqrt64.9%
associate-*r*65.1%
Applied egg-rr65.1%
if 7.5000000000000006e-30 < x Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
distribute-rgt-in99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
fma-neg99.6%
associate-*r*99.5%
*-commutative99.5%
associate-*r*99.6%
distribute-rgt-neg-in99.6%
*-commutative99.6%
associate-/r*99.5%
associate-/r/99.5%
mul-1-neg99.5%
metadata-eval99.5%
Simplified99.6%
Taylor expanded in x around inf 97.1%
Final simplification88.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sqrt x) (/ 0.3333333333333333 x))) (t_1 (* 3.0 (sqrt x))))
(if (<= x 7.2e-131)
t_0
(if (<= x 1.05e-72) (* y t_1) (if (<= x 7e-30) t_0 (* t_1 (+ y -1.0)))))))
double code(double x, double y) {
double t_0 = sqrt(x) * (0.3333333333333333 / x);
double t_1 = 3.0 * sqrt(x);
double tmp;
if (x <= 7.2e-131) {
tmp = t_0;
} else if (x <= 1.05e-72) {
tmp = y * t_1;
} else if (x <= 7e-30) {
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(x) * (0.3333333333333333d0 / x)
t_1 = 3.0d0 * sqrt(x)
if (x <= 7.2d-131) then
tmp = t_0
else if (x <= 1.05d-72) then
tmp = y * t_1
else if (x <= 7d-30) 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(x) * (0.3333333333333333 / x);
double t_1 = 3.0 * Math.sqrt(x);
double tmp;
if (x <= 7.2e-131) {
tmp = t_0;
} else if (x <= 1.05e-72) {
tmp = y * t_1;
} else if (x <= 7e-30) {
tmp = t_0;
} else {
tmp = t_1 * (y + -1.0);
}
return tmp;
}
def code(x, y): t_0 = math.sqrt(x) * (0.3333333333333333 / x) t_1 = 3.0 * math.sqrt(x) tmp = 0 if x <= 7.2e-131: tmp = t_0 elif x <= 1.05e-72: tmp = y * t_1 elif x <= 7e-30: tmp = t_0 else: tmp = t_1 * (y + -1.0) return tmp
function code(x, y) t_0 = Float64(sqrt(x) * Float64(0.3333333333333333 / x)) t_1 = Float64(3.0 * sqrt(x)) tmp = 0.0 if (x <= 7.2e-131) tmp = t_0; elseif (x <= 1.05e-72) tmp = Float64(y * t_1); elseif (x <= 7e-30) 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(x) * (0.3333333333333333 / x); t_1 = 3.0 * sqrt(x); tmp = 0.0; if (x <= 7.2e-131) tmp = t_0; elseif (x <= 1.05e-72) tmp = y * t_1; elseif (x <= 7e-30) tmp = t_0; else tmp = t_1 * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[x], $MachinePrecision] * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 7.2e-131], t$95$0, If[LessEqual[x, 1.05e-72], N[(y * t$95$1), $MachinePrecision], If[LessEqual[x, 7e-30], t$95$0, N[(t$95$1 * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x} \cdot \frac{0.3333333333333333}{x}\\
t_1 := 3 \cdot \sqrt{x}\\
\mathbf{if}\;x \leq 7.2 \cdot 10^{-131}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-72}:\\
\;\;\;\;y \cdot t_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-30}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < 7.1999999999999999e-131 or 1.05e-72 < x < 7.0000000000000006e-30Initial program 99.1%
+-commutative99.1%
associate--l+99.1%
distribute-rgt-in99.1%
+-commutative99.1%
fma-def99.2%
remove-double-neg99.2%
fma-neg99.1%
associate-*r*99.1%
*-commutative99.1%
associate-*r*99.2%
distribute-rgt-neg-in99.2%
*-commutative99.2%
associate-/r*99.1%
associate-/r/99.1%
mul-1-neg99.1%
metadata-eval99.1%
Simplified99.2%
Taylor expanded in x around 0 81.2%
if 7.1999999999999999e-131 < x < 1.05e-72Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
fma-neg99.6%
associate-*r*99.5%
*-commutative99.5%
associate-*r*99.3%
distribute-rgt-neg-in99.3%
*-commutative99.3%
associate-/r*99.5%
associate-/r/99.4%
mul-1-neg99.4%
metadata-eval99.4%
Simplified99.6%
Taylor expanded in y around inf 64.9%
add-sqr-sqrt29.3%
pow229.3%
*-commutative29.3%
Applied egg-rr29.3%
unpow229.3%
add-sqr-sqrt64.9%
associate-*r*65.1%
Applied egg-rr65.1%
if 7.0000000000000006e-30 < x Initial program 99.6%
Taylor expanded in y around inf 97.1%
Final simplification88.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sqrt x) (/ 0.3333333333333333 x))))
(if (<= x 5.2e-131)
t_0
(if (<= x 1.7e-72)
(* y (* 3.0 (sqrt x)))
(if (<= x 1e-29) t_0 (* 3.0 (* (sqrt x) (+ y -1.0))))))))
double code(double x, double y) {
double t_0 = sqrt(x) * (0.3333333333333333 / x);
double tmp;
if (x <= 5.2e-131) {
tmp = t_0;
} else if (x <= 1.7e-72) {
tmp = y * (3.0 * sqrt(x));
} else if (x <= 1e-29) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = sqrt(x) * (0.3333333333333333d0 / x)
if (x <= 5.2d-131) then
tmp = t_0
else if (x <= 1.7d-72) then
tmp = y * (3.0d0 * sqrt(x))
else if (x <= 1d-29) then
tmp = t_0
else
tmp = 3.0d0 * (sqrt(x) * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt(x) * (0.3333333333333333 / x);
double tmp;
if (x <= 5.2e-131) {
tmp = t_0;
} else if (x <= 1.7e-72) {
tmp = y * (3.0 * Math.sqrt(x));
} else if (x <= 1e-29) {
tmp = t_0;
} else {
tmp = 3.0 * (Math.sqrt(x) * (y + -1.0));
}
return tmp;
}
def code(x, y): t_0 = math.sqrt(x) * (0.3333333333333333 / x) tmp = 0 if x <= 5.2e-131: tmp = t_0 elif x <= 1.7e-72: tmp = y * (3.0 * math.sqrt(x)) elif x <= 1e-29: tmp = t_0 else: tmp = 3.0 * (math.sqrt(x) * (y + -1.0)) return tmp
function code(x, y) t_0 = Float64(sqrt(x) * Float64(0.3333333333333333 / x)) tmp = 0.0 if (x <= 5.2e-131) tmp = t_0; elseif (x <= 1.7e-72) tmp = Float64(y * Float64(3.0 * sqrt(x))); elseif (x <= 1e-29) tmp = t_0; else tmp = Float64(3.0 * Float64(sqrt(x) * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt(x) * (0.3333333333333333 / x); tmp = 0.0; if (x <= 5.2e-131) tmp = t_0; elseif (x <= 1.7e-72) tmp = y * (3.0 * sqrt(x)); elseif (x <= 1e-29) tmp = t_0; else tmp = 3.0 * (sqrt(x) * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[x], $MachinePrecision] * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 5.2e-131], t$95$0, If[LessEqual[x, 1.7e-72], N[(y * N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1e-29], t$95$0, N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x} \cdot \frac{0.3333333333333333}{x}\\
\mathbf{if}\;x \leq 5.2 \cdot 10^{-131}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-72}:\\
\;\;\;\;y \cdot \left(3 \cdot \sqrt{x}\right)\\
\mathbf{elif}\;x \leq 10^{-29}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if x < 5.19999999999999993e-131 or 1.6999999999999999e-72 < x < 9.99999999999999943e-30Initial program 99.1%
+-commutative99.1%
associate--l+99.1%
distribute-rgt-in99.1%
+-commutative99.1%
fma-def99.2%
remove-double-neg99.2%
fma-neg99.1%
associate-*r*99.1%
*-commutative99.1%
associate-*r*99.2%
distribute-rgt-neg-in99.2%
*-commutative99.2%
associate-/r*99.1%
associate-/r/99.1%
mul-1-neg99.1%
metadata-eval99.1%
Simplified99.2%
Taylor expanded in x around 0 81.2%
if 5.19999999999999993e-131 < x < 1.6999999999999999e-72Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
fma-neg99.6%
associate-*r*99.5%
*-commutative99.5%
associate-*r*99.3%
distribute-rgt-neg-in99.3%
*-commutative99.3%
associate-/r*99.5%
associate-/r/99.4%
mul-1-neg99.4%
metadata-eval99.4%
Simplified99.6%
Taylor expanded in y around inf 64.9%
add-sqr-sqrt29.3%
pow229.3%
*-commutative29.3%
Applied egg-rr29.3%
unpow229.3%
add-sqr-sqrt64.9%
associate-*r*65.1%
Applied egg-rr65.1%
if 9.99999999999999943e-30 < x Initial program 99.6%
Taylor expanded in y around inf 97.1%
add-cube-cbrt95.6%
pow395.6%
*-commutative95.6%
*-commutative95.6%
sub-neg95.6%
metadata-eval95.6%
Applied egg-rr95.6%
rem-cube-cbrt97.1%
associate-*r*97.1%
*-commutative97.1%
Applied egg-rr97.1%
Final simplification88.3%
(FPCore (x y) :precision binary64 (if (or (<= y -0.07) (not (<= y 7.2e-7))) (* 3.0 (* (sqrt x) y)) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if ((y <= -0.07) || !(y <= 7.2e-7)) {
tmp = 3.0 * (sqrt(x) * y);
} 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 ((y <= (-0.07d0)) .or. (.not. (y <= 7.2d-7))) then
tmp = 3.0d0 * (sqrt(x) * y)
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -0.07) || !(y <= 7.2e-7)) {
tmp = 3.0 * (Math.sqrt(x) * y);
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -0.07) or not (y <= 7.2e-7): tmp = 3.0 * (math.sqrt(x) * y) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if ((y <= -0.07) || !(y <= 7.2e-7)) tmp = Float64(3.0 * Float64(sqrt(x) * y)); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -0.07) || ~((y <= 7.2e-7))) tmp = 3.0 * (sqrt(x) * y); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -0.07], N[Not[LessEqual[y, 7.2e-7]], $MachinePrecision]], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.07 \lor \neg \left(y \leq 7.2 \cdot 10^{-7}\right):\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if y < -0.070000000000000007 or 7.19999999999999989e-7 < y Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
distribute-rgt-in99.4%
+-commutative99.4%
fma-def99.4%
remove-double-neg99.4%
fma-neg99.4%
associate-*r*99.4%
*-commutative99.4%
associate-*r*99.4%
distribute-rgt-neg-in99.4%
*-commutative99.4%
associate-/r*99.4%
associate-/r/99.3%
mul-1-neg99.3%
metadata-eval99.3%
Simplified99.4%
Taylor expanded in y around inf 74.0%
if -0.070000000000000007 < y < 7.19999999999999989e-7Initial program 99.4%
Taylor expanded in y around inf 56.1%
Taylor expanded in y around 0 55.8%
*-commutative55.8%
Simplified55.8%
Final simplification65.9%
(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.4%
Taylor expanded in y around inf 67.1%
Taylor expanded in y around 0 26.7%
*-commutative26.7%
Simplified26.7%
add-sqr-sqrt0.0%
sqrt-unprod2.9%
swap-sqr2.9%
add-sqr-sqrt2.9%
metadata-eval2.9%
Applied egg-rr2.9%
Final simplification2.9%
(FPCore (x y) :precision binary64 (* (sqrt x) -3.0))
double code(double x, double y) {
return sqrt(x) * -3.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(x) * (-3.0d0)
end function
public static double code(double x, double y) {
return Math.sqrt(x) * -3.0;
}
def code(x, y): return math.sqrt(x) * -3.0
function code(x, y) return Float64(sqrt(x) * -3.0) end
function tmp = code(x, y) tmp = sqrt(x) * -3.0; end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x} \cdot -3
\end{array}
Initial program 99.4%
Taylor expanded in y around inf 67.1%
Taylor expanded in y around 0 26.7%
*-commutative26.7%
Simplified26.7%
Final simplification26.7%
(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 2023181
(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)))