
(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 (* (sqrt (* x 9.0)) (+ (/ 0.1111111111111111 x) (+ y -1.0))))
double code(double x, double y) {
return sqrt((x * 9.0)) * ((0.1111111111111111 / x) + (y + -1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt((x * 9.0d0)) * ((0.1111111111111111d0 / x) + (y + (-1.0d0)))
end function
public static double code(double x, double y) {
return Math.sqrt((x * 9.0)) * ((0.1111111111111111 / x) + (y + -1.0));
}
def code(x, y): return math.sqrt((x * 9.0)) * ((0.1111111111111111 / x) + (y + -1.0))
function code(x, y) return Float64(sqrt(Float64(x * 9.0)) * Float64(Float64(0.1111111111111111 / x) + Float64(y + -1.0))) end
function tmp = code(x, y) tmp = sqrt((x * 9.0)) * ((0.1111111111111111 / x) + (y + -1.0)); end
code[x_, y_] := N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x \cdot 9} \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)
\end{array}
Initial program 99.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.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.4%
associate-/l/99.4%
associate-/r/99.5%
Simplified99.5%
add-sqr-sqrt99.1%
pow299.1%
Applied egg-rr99.1%
unpow299.1%
add-sqr-sqrt99.5%
expm1-log1p-u96.1%
expm1-udef55.3%
add-sqr-sqrt55.3%
sqrt-unprod55.3%
*-commutative55.3%
*-commutative55.3%
swap-sqr55.3%
add-sqr-sqrt55.3%
metadata-eval55.3%
Applied egg-rr55.3%
expm1-def96.2%
expm1-log1p99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 3.0 (* y (sqrt x))))
(t_1 (* (sqrt x) -3.0))
(t_2 (sqrt (/ 0.1111111111111111 x))))
(if (<= y -0.0005)
t_0
(if (<= y -1.6e-172)
t_1
(if (<= y -8.2e-187)
(sqrt (+ (/ 0.1111111111111111 x) -2.0))
(if (<= y -1.45e-218)
t_1
(if (<= y -1.02e-272)
t_2
(if (<= y 1.6e-280)
t_1
(if (<= y 1.9e-194) t_2 (if (<= y 2.1e-6) t_1 t_0))))))))))
double code(double x, double y) {
double t_0 = 3.0 * (y * sqrt(x));
double t_1 = sqrt(x) * -3.0;
double t_2 = sqrt((0.1111111111111111 / x));
double tmp;
if (y <= -0.0005) {
tmp = t_0;
} else if (y <= -1.6e-172) {
tmp = t_1;
} else if (y <= -8.2e-187) {
tmp = sqrt(((0.1111111111111111 / x) + -2.0));
} else if (y <= -1.45e-218) {
tmp = t_1;
} else if (y <= -1.02e-272) {
tmp = t_2;
} else if (y <= 1.6e-280) {
tmp = t_1;
} else if (y <= 1.9e-194) {
tmp = t_2;
} else if (y <= 2.1e-6) {
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 * (y * sqrt(x))
t_1 = sqrt(x) * (-3.0d0)
t_2 = sqrt((0.1111111111111111d0 / x))
if (y <= (-0.0005d0)) then
tmp = t_0
else if (y <= (-1.6d-172)) then
tmp = t_1
else if (y <= (-8.2d-187)) then
tmp = sqrt(((0.1111111111111111d0 / x) + (-2.0d0)))
else if (y <= (-1.45d-218)) then
tmp = t_1
else if (y <= (-1.02d-272)) then
tmp = t_2
else if (y <= 1.6d-280) then
tmp = t_1
else if (y <= 1.9d-194) then
tmp = t_2
else if (y <= 2.1d-6) 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 * (y * Math.sqrt(x));
double t_1 = Math.sqrt(x) * -3.0;
double t_2 = Math.sqrt((0.1111111111111111 / x));
double tmp;
if (y <= -0.0005) {
tmp = t_0;
} else if (y <= -1.6e-172) {
tmp = t_1;
} else if (y <= -8.2e-187) {
tmp = Math.sqrt(((0.1111111111111111 / x) + -2.0));
} else if (y <= -1.45e-218) {
tmp = t_1;
} else if (y <= -1.02e-272) {
tmp = t_2;
} else if (y <= 1.6e-280) {
tmp = t_1;
} else if (y <= 1.9e-194) {
tmp = t_2;
} else if (y <= 2.1e-6) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 3.0 * (y * math.sqrt(x)) t_1 = math.sqrt(x) * -3.0 t_2 = math.sqrt((0.1111111111111111 / x)) tmp = 0 if y <= -0.0005: tmp = t_0 elif y <= -1.6e-172: tmp = t_1 elif y <= -8.2e-187: tmp = math.sqrt(((0.1111111111111111 / x) + -2.0)) elif y <= -1.45e-218: tmp = t_1 elif y <= -1.02e-272: tmp = t_2 elif y <= 1.6e-280: tmp = t_1 elif y <= 1.9e-194: tmp = t_2 elif y <= 2.1e-6: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(3.0 * Float64(y * sqrt(x))) t_1 = Float64(sqrt(x) * -3.0) t_2 = sqrt(Float64(0.1111111111111111 / x)) tmp = 0.0 if (y <= -0.0005) tmp = t_0; elseif (y <= -1.6e-172) tmp = t_1; elseif (y <= -8.2e-187) tmp = sqrt(Float64(Float64(0.1111111111111111 / x) + -2.0)); elseif (y <= -1.45e-218) tmp = t_1; elseif (y <= -1.02e-272) tmp = t_2; elseif (y <= 1.6e-280) tmp = t_1; elseif (y <= 1.9e-194) tmp = t_2; elseif (y <= 2.1e-6) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 3.0 * (y * sqrt(x)); t_1 = sqrt(x) * -3.0; t_2 = sqrt((0.1111111111111111 / x)); tmp = 0.0; if (y <= -0.0005) tmp = t_0; elseif (y <= -1.6e-172) tmp = t_1; elseif (y <= -8.2e-187) tmp = sqrt(((0.1111111111111111 / x) + -2.0)); elseif (y <= -1.45e-218) tmp = t_1; elseif (y <= -1.02e-272) tmp = t_2; elseif (y <= 1.6e-280) tmp = t_1; elseif (y <= 1.9e-194) tmp = t_2; elseif (y <= 2.1e-6) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -0.0005], t$95$0, If[LessEqual[y, -1.6e-172], t$95$1, If[LessEqual[y, -8.2e-187], N[Sqrt[N[(N[(0.1111111111111111 / x), $MachinePrecision] + -2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, -1.45e-218], t$95$1, If[LessEqual[y, -1.02e-272], t$95$2, If[LessEqual[y, 1.6e-280], t$95$1, If[LessEqual[y, 1.9e-194], t$95$2, If[LessEqual[y, 2.1e-6], t$95$1, t$95$0]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(y \cdot \sqrt{x}\right)\\
t_1 := \sqrt{x} \cdot -3\\
t_2 := \sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{if}\;y \leq -0.0005:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{-172}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -8.2 \cdot 10^{-187}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x} + -2}\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-218}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.02 \cdot 10^{-272}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-280}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-194}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -5.0000000000000001e-4 or 2.0999999999999998e-6 < y Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.5%
associate-/l/99.5%
associate-/r/99.5%
Simplified99.5%
Taylor expanded in y around inf 75.9%
*-commutative75.9%
Simplified75.9%
if -5.0000000000000001e-4 < y < -1.6000000000000001e-172 or -8.2000000000000004e-187 < y < -1.4500000000000001e-218 or -1.01999999999999993e-272 < y < 1.6e-280 or 1.9000000000000001e-194 < y < 2.0999999999999998e-6Initial 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.3%
associate-/l/99.3%
associate-/r/99.4%
Simplified99.4%
add-sqr-sqrt99.0%
pow299.0%
Applied egg-rr99.0%
Taylor expanded in y around 0 97.1%
*-commutative97.1%
*-commutative97.1%
unpow297.1%
rem-square-sqrt97.9%
sub-neg97.9%
associate-*r/97.9%
metadata-eval97.9%
metadata-eval97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in x around inf 67.8%
if -1.6000000000000001e-172 < y < -8.2000000000000004e-187Initial 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*98.7%
distribute-neg-frac98.7%
*-commutative98.7%
associate-/r/99.0%
associate-/l/99.0%
associate-/r/98.7%
Simplified98.7%
add-sqr-sqrt99.0%
pow299.0%
Applied egg-rr99.0%
Taylor expanded in y around 0 98.0%
associate-*l*98.3%
*-commutative98.3%
unpow298.3%
rem-square-sqrt99.2%
*-commutative99.2%
associate-*r*99.5%
*-commutative99.5%
associate-*l*99.5%
sub-neg99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
add-sqr-sqrt99.2%
sqrt-unprod99.5%
swap-sqr99.3%
metadata-eval99.3%
*-commutative99.3%
*-commutative99.3%
swap-sqr52.1%
add-sqr-sqrt51.8%
pow251.8%
+-commutative51.8%
Applied egg-rr51.8%
rem-square-sqrt52.1%
unpow252.1%
swap-sqr99.3%
*-commutative99.3%
metadata-eval99.3%
swap-sqr99.5%
*-commutative99.5%
*-commutative99.5%
associate-*r*99.2%
metadata-eval99.2%
associate-*r/99.5%
metadata-eval99.5%
sub-neg99.5%
*-commutative99.5%
*-commutative99.5%
associate-*r*99.5%
Simplified51.8%
Taylor expanded in x around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
if -1.4500000000000001e-218 < y < -1.01999999999999993e-272 or 1.6e-280 < y < 1.9000000000000001e-194Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.2%
associate-/l/99.2%
associate-/r/99.5%
Simplified99.5%
add-sqr-sqrt99.1%
pow299.1%
Applied egg-rr99.1%
Taylor expanded in y around 0 98.4%
associate-*l*98.4%
*-commutative98.4%
unpow298.4%
rem-square-sqrt99.3%
*-commutative99.3%
associate-*r*99.2%
*-commutative99.2%
associate-*l*99.3%
sub-neg99.3%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
+-commutative99.4%
Simplified99.4%
add-sqr-sqrt74.2%
sqrt-unprod74.8%
swap-sqr74.7%
metadata-eval74.7%
*-commutative74.7%
*-commutative74.7%
swap-sqr30.1%
add-sqr-sqrt30.2%
pow230.2%
+-commutative30.2%
Applied egg-rr30.2%
rem-square-sqrt30.1%
unpow230.1%
swap-sqr74.7%
*-commutative74.7%
metadata-eval74.7%
swap-sqr74.8%
*-commutative74.8%
*-commutative74.8%
associate-*r*74.7%
metadata-eval74.7%
associate-*r/74.6%
metadata-eval74.6%
sub-neg74.6%
*-commutative74.6%
*-commutative74.6%
associate-*r*74.7%
Simplified30.2%
Taylor expanded in x around 0 75.0%
Final simplification73.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 3.0 (* y (sqrt x)))) (t_1 (* (sqrt x) -3.0)))
(if (<= y -0.0005)
t_0
(if (<= y -4.6e-173)
t_1
(if (<= y -1.2e-188)
(sqrt (+ (/ 0.1111111111111111 x) -2.0))
(if (<= y -3.5e-218)
t_1
(if (<= y -2.6e-261)
(* (sqrt x) (/ 0.3333333333333333 x))
(if (<= y 6.2e-281)
t_1
(if (<= y 5.5e-193)
(sqrt (/ 0.1111111111111111 x))
(if (<= y 2.1e-6) t_1 t_0))))))))))
double code(double x, double y) {
double t_0 = 3.0 * (y * sqrt(x));
double t_1 = sqrt(x) * -3.0;
double tmp;
if (y <= -0.0005) {
tmp = t_0;
} else if (y <= -4.6e-173) {
tmp = t_1;
} else if (y <= -1.2e-188) {
tmp = sqrt(((0.1111111111111111 / x) + -2.0));
} else if (y <= -3.5e-218) {
tmp = t_1;
} else if (y <= -2.6e-261) {
tmp = sqrt(x) * (0.3333333333333333 / x);
} else if (y <= 6.2e-281) {
tmp = t_1;
} else if (y <= 5.5e-193) {
tmp = sqrt((0.1111111111111111 / x));
} else if (y <= 2.1e-6) {
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) :: tmp
t_0 = 3.0d0 * (y * sqrt(x))
t_1 = sqrt(x) * (-3.0d0)
if (y <= (-0.0005d0)) then
tmp = t_0
else if (y <= (-4.6d-173)) then
tmp = t_1
else if (y <= (-1.2d-188)) then
tmp = sqrt(((0.1111111111111111d0 / x) + (-2.0d0)))
else if (y <= (-3.5d-218)) then
tmp = t_1
else if (y <= (-2.6d-261)) then
tmp = sqrt(x) * (0.3333333333333333d0 / x)
else if (y <= 6.2d-281) then
tmp = t_1
else if (y <= 5.5d-193) then
tmp = sqrt((0.1111111111111111d0 / x))
else if (y <= 2.1d-6) 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 * (y * Math.sqrt(x));
double t_1 = Math.sqrt(x) * -3.0;
double tmp;
if (y <= -0.0005) {
tmp = t_0;
} else if (y <= -4.6e-173) {
tmp = t_1;
} else if (y <= -1.2e-188) {
tmp = Math.sqrt(((0.1111111111111111 / x) + -2.0));
} else if (y <= -3.5e-218) {
tmp = t_1;
} else if (y <= -2.6e-261) {
tmp = Math.sqrt(x) * (0.3333333333333333 / x);
} else if (y <= 6.2e-281) {
tmp = t_1;
} else if (y <= 5.5e-193) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else if (y <= 2.1e-6) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 3.0 * (y * math.sqrt(x)) t_1 = math.sqrt(x) * -3.0 tmp = 0 if y <= -0.0005: tmp = t_0 elif y <= -4.6e-173: tmp = t_1 elif y <= -1.2e-188: tmp = math.sqrt(((0.1111111111111111 / x) + -2.0)) elif y <= -3.5e-218: tmp = t_1 elif y <= -2.6e-261: tmp = math.sqrt(x) * (0.3333333333333333 / x) elif y <= 6.2e-281: tmp = t_1 elif y <= 5.5e-193: tmp = math.sqrt((0.1111111111111111 / x)) elif y <= 2.1e-6: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(3.0 * Float64(y * sqrt(x))) t_1 = Float64(sqrt(x) * -3.0) tmp = 0.0 if (y <= -0.0005) tmp = t_0; elseif (y <= -4.6e-173) tmp = t_1; elseif (y <= -1.2e-188) tmp = sqrt(Float64(Float64(0.1111111111111111 / x) + -2.0)); elseif (y <= -3.5e-218) tmp = t_1; elseif (y <= -2.6e-261) tmp = Float64(sqrt(x) * Float64(0.3333333333333333 / x)); elseif (y <= 6.2e-281) tmp = t_1; elseif (y <= 5.5e-193) tmp = sqrt(Float64(0.1111111111111111 / x)); elseif (y <= 2.1e-6) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 3.0 * (y * sqrt(x)); t_1 = sqrt(x) * -3.0; tmp = 0.0; if (y <= -0.0005) tmp = t_0; elseif (y <= -4.6e-173) tmp = t_1; elseif (y <= -1.2e-188) tmp = sqrt(((0.1111111111111111 / x) + -2.0)); elseif (y <= -3.5e-218) tmp = t_1; elseif (y <= -2.6e-261) tmp = sqrt(x) * (0.3333333333333333 / x); elseif (y <= 6.2e-281) tmp = t_1; elseif (y <= 5.5e-193) tmp = sqrt((0.1111111111111111 / x)); elseif (y <= 2.1e-6) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]}, If[LessEqual[y, -0.0005], t$95$0, If[LessEqual[y, -4.6e-173], t$95$1, If[LessEqual[y, -1.2e-188], N[Sqrt[N[(N[(0.1111111111111111 / x), $MachinePrecision] + -2.0), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, -3.5e-218], t$95$1, If[LessEqual[y, -2.6e-261], N[(N[Sqrt[x], $MachinePrecision] * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e-281], t$95$1, If[LessEqual[y, 5.5e-193], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], If[LessEqual[y, 2.1e-6], t$95$1, t$95$0]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 3 \cdot \left(y \cdot \sqrt{x}\right)\\
t_1 := \sqrt{x} \cdot -3\\
\mathbf{if}\;y \leq -0.0005:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{-173}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{-188}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x} + -2}\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-218}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.6 \cdot 10^{-261}:\\
\;\;\;\;\sqrt{x} \cdot \frac{0.3333333333333333}{x}\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-281}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-193}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -5.0000000000000001e-4 or 2.0999999999999998e-6 < y Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.5%
associate-/l/99.5%
associate-/r/99.5%
Simplified99.5%
Taylor expanded in y around inf 75.9%
*-commutative75.9%
Simplified75.9%
if -5.0000000000000001e-4 < y < -4.59999999999999976e-173 or -1.2e-188 < y < -3.5e-218 or -2.6000000000000001e-261 < y < 6.2000000000000004e-281 or 5.50000000000000014e-193 < y < 2.0999999999999998e-6Initial 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.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.3%
associate-/l/99.3%
associate-/r/99.5%
Simplified99.5%
add-sqr-sqrt99.0%
pow299.0%
Applied egg-rr99.0%
Taylor expanded in y around 0 97.2%
*-commutative97.2%
*-commutative97.2%
unpow297.2%
rem-square-sqrt98.0%
sub-neg98.0%
associate-*r/98.0%
metadata-eval98.0%
metadata-eval98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in x around inf 67.0%
if -4.59999999999999976e-173 < y < -1.2e-188Initial 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*98.7%
distribute-neg-frac98.7%
*-commutative98.7%
associate-/r/99.0%
associate-/l/99.0%
associate-/r/98.7%
Simplified98.7%
add-sqr-sqrt99.0%
pow299.0%
Applied egg-rr99.0%
Taylor expanded in y around 0 98.0%
associate-*l*98.3%
*-commutative98.3%
unpow298.3%
rem-square-sqrt99.2%
*-commutative99.2%
associate-*r*99.5%
*-commutative99.5%
associate-*l*99.5%
sub-neg99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
add-sqr-sqrt99.2%
sqrt-unprod99.5%
swap-sqr99.3%
metadata-eval99.3%
*-commutative99.3%
*-commutative99.3%
swap-sqr52.1%
add-sqr-sqrt51.8%
pow251.8%
+-commutative51.8%
Applied egg-rr51.8%
rem-square-sqrt52.1%
unpow252.1%
swap-sqr99.3%
*-commutative99.3%
metadata-eval99.3%
swap-sqr99.5%
*-commutative99.5%
*-commutative99.5%
associate-*r*99.2%
metadata-eval99.2%
associate-*r/99.5%
metadata-eval99.5%
sub-neg99.5%
*-commutative99.5%
*-commutative99.5%
associate-*r*99.5%
Simplified51.8%
Taylor expanded in x around 0 100.0%
sub-neg100.0%
associate-*r/100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
if -3.5e-218 < y < -2.6000000000000001e-261Initial 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.1%
*-commutative99.1%
associate-*r*99.3%
distribute-rgt-neg-in99.3%
*-commutative99.3%
associate-/r*99.1%
associate-/r/99.6%
mul-1-neg99.6%
metadata-eval99.6%
Simplified99.8%
Taylor expanded in x around 0 99.8%
if 6.2000000000000004e-281 < y < 5.50000000000000014e-193Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.1%
associate-/l/99.1%
associate-/r/99.5%
Simplified99.5%
add-sqr-sqrt99.2%
pow299.2%
Applied egg-rr99.2%
Taylor expanded in y around 0 98.5%
associate-*l*98.4%
*-commutative98.4%
unpow298.4%
rem-square-sqrt99.3%
*-commutative99.3%
associate-*r*99.1%
*-commutative99.1%
associate-*l*99.1%
sub-neg99.1%
associate-*r/99.2%
metadata-eval99.2%
metadata-eval99.2%
+-commutative99.2%
Simplified99.2%
add-sqr-sqrt70.6%
sqrt-unprod71.1%
swap-sqr71.1%
metadata-eval71.1%
*-commutative71.1%
*-commutative71.1%
swap-sqr30.5%
add-sqr-sqrt30.5%
pow230.5%
+-commutative30.5%
Applied egg-rr30.5%
rem-square-sqrt30.5%
unpow230.5%
swap-sqr71.1%
*-commutative71.1%
metadata-eval71.1%
swap-sqr71.1%
*-commutative71.1%
*-commutative71.1%
associate-*r*71.2%
metadata-eval71.2%
associate-*r/71.1%
metadata-eval71.1%
sub-neg71.1%
*-commutative71.1%
*-commutative71.1%
associate-*r*71.2%
Simplified30.4%
Taylor expanded in x around 0 71.5%
Final simplification73.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sqrt x) 3.0)))
(if (or (<= y -220000000000.0) (not (<= y 17000000000.0)))
(* (+ y -1.0) t_0)
(* t_0 (+ (/ 0.1111111111111111 x) -1.0)))))
double code(double x, double y) {
double t_0 = sqrt(x) * 3.0;
double tmp;
if ((y <= -220000000000.0) || !(y <= 17000000000.0)) {
tmp = (y + -1.0) * t_0;
} else {
tmp = t_0 * ((0.1111111111111111 / x) + -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
if ((y <= (-220000000000.0d0)) .or. (.not. (y <= 17000000000.0d0))) then
tmp = (y + (-1.0d0)) * t_0
else
tmp = t_0 * ((0.1111111111111111d0 / x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt(x) * 3.0;
double tmp;
if ((y <= -220000000000.0) || !(y <= 17000000000.0)) {
tmp = (y + -1.0) * t_0;
} else {
tmp = t_0 * ((0.1111111111111111 / x) + -1.0);
}
return tmp;
}
def code(x, y): t_0 = math.sqrt(x) * 3.0 tmp = 0 if (y <= -220000000000.0) or not (y <= 17000000000.0): tmp = (y + -1.0) * t_0 else: tmp = t_0 * ((0.1111111111111111 / x) + -1.0) return tmp
function code(x, y) t_0 = Float64(sqrt(x) * 3.0) tmp = 0.0 if ((y <= -220000000000.0) || !(y <= 17000000000.0)) tmp = Float64(Float64(y + -1.0) * t_0); else tmp = Float64(t_0 * Float64(Float64(0.1111111111111111 / x) + -1.0)); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt(x) * 3.0; tmp = 0.0; if ((y <= -220000000000.0) || ~((y <= 17000000000.0))) tmp = (y + -1.0) * t_0; else tmp = t_0 * ((0.1111111111111111 / x) + -1.0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[x], $MachinePrecision] * 3.0), $MachinePrecision]}, If[Or[LessEqual[y, -220000000000.0], N[Not[LessEqual[y, 17000000000.0]], $MachinePrecision]], N[(N[(y + -1.0), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$0 * N[(N[(0.1111111111111111 / x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x} \cdot 3\\
\mathbf{if}\;y \leq -220000000000 \lor \neg \left(y \leq 17000000000\right):\\
\;\;\;\;\left(y + -1\right) \cdot t_0\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\frac{0.1111111111111111}{x} + -1\right)\\
\end{array}
\end{array}
if y < -2.2e11 or 1.7e10 < y Initial program 99.5%
Taylor expanded in y around inf 79.4%
if -2.2e11 < y < 1.7e10Initial 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.3%
associate-/l/99.3%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in y around 0 98.4%
*-commutative98.4%
sub-neg98.4%
associate-*r/98.4%
metadata-eval98.4%
metadata-eval98.4%
associate-*l*98.5%
Simplified98.5%
Final simplification89.0%
(FPCore (x y) :precision binary64 (if (or (<= y -33000000000.0) (not (<= y 160000000000.0))) (* 3.0 (* y (sqrt x))) (* (sqrt x) (+ -3.0 (/ 0.3333333333333333 x)))))
double code(double x, double y) {
double tmp;
if ((y <= -33000000000.0) || !(y <= 160000000000.0)) {
tmp = 3.0 * (y * sqrt(x));
} else {
tmp = sqrt(x) * (-3.0 + (0.3333333333333333 / x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-33000000000.0d0)) .or. (.not. (y <= 160000000000.0d0))) then
tmp = 3.0d0 * (y * sqrt(x))
else
tmp = sqrt(x) * ((-3.0d0) + (0.3333333333333333d0 / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -33000000000.0) || !(y <= 160000000000.0)) {
tmp = 3.0 * (y * Math.sqrt(x));
} else {
tmp = Math.sqrt(x) * (-3.0 + (0.3333333333333333 / x));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -33000000000.0) or not (y <= 160000000000.0): tmp = 3.0 * (y * math.sqrt(x)) else: tmp = math.sqrt(x) * (-3.0 + (0.3333333333333333 / x)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -33000000000.0) || !(y <= 160000000000.0)) tmp = Float64(3.0 * Float64(y * sqrt(x))); else tmp = Float64(sqrt(x) * Float64(-3.0 + Float64(0.3333333333333333 / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -33000000000.0) || ~((y <= 160000000000.0))) tmp = 3.0 * (y * sqrt(x)); else tmp = sqrt(x) * (-3.0 + (0.3333333333333333 / x)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -33000000000.0], N[Not[LessEqual[y, 160000000000.0]], $MachinePrecision]], N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -33000000000 \lor \neg \left(y \leq 160000000000\right):\\
\;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(-3 + \frac{0.3333333333333333}{x}\right)\\
\end{array}
\end{array}
if y < -3.3e10 or 1.6e11 < y Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.5%
associate-/l/99.5%
associate-/r/99.5%
Simplified99.5%
Taylor expanded in y around inf 78.8%
*-commutative78.8%
Simplified78.8%
if -3.3e10 < y < 1.6e11Initial 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.3%
associate-/l/99.3%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in y around 0 98.4%
associate-*r*98.4%
sub-neg98.4%
associate-*r/98.4%
metadata-eval98.4%
metadata-eval98.4%
distribute-rgt-in98.4%
associate-*l/98.5%
metadata-eval98.5%
metadata-eval98.5%
+-commutative98.5%
*-commutative98.5%
+-commutative98.5%
Simplified98.5%
Final simplification88.7%
(FPCore (x y) :precision binary64 (if (or (<= y -950000000.0) (not (<= y 200000000.0))) (* (+ y -1.0) (* (sqrt x) 3.0)) (* (sqrt x) (+ -3.0 (/ 0.3333333333333333 x)))))
double code(double x, double y) {
double tmp;
if ((y <= -950000000.0) || !(y <= 200000000.0)) {
tmp = (y + -1.0) * (sqrt(x) * 3.0);
} else {
tmp = sqrt(x) * (-3.0 + (0.3333333333333333 / x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-950000000.0d0)) .or. (.not. (y <= 200000000.0d0))) then
tmp = (y + (-1.0d0)) * (sqrt(x) * 3.0d0)
else
tmp = sqrt(x) * ((-3.0d0) + (0.3333333333333333d0 / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -950000000.0) || !(y <= 200000000.0)) {
tmp = (y + -1.0) * (Math.sqrt(x) * 3.0);
} else {
tmp = Math.sqrt(x) * (-3.0 + (0.3333333333333333 / x));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -950000000.0) or not (y <= 200000000.0): tmp = (y + -1.0) * (math.sqrt(x) * 3.0) else: tmp = math.sqrt(x) * (-3.0 + (0.3333333333333333 / x)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -950000000.0) || !(y <= 200000000.0)) tmp = Float64(Float64(y + -1.0) * Float64(sqrt(x) * 3.0)); else tmp = Float64(sqrt(x) * Float64(-3.0 + Float64(0.3333333333333333 / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -950000000.0) || ~((y <= 200000000.0))) tmp = (y + -1.0) * (sqrt(x) * 3.0); else tmp = sqrt(x) * (-3.0 + (0.3333333333333333 / x)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -950000000.0], N[Not[LessEqual[y, 200000000.0]], $MachinePrecision]], N[(N[(y + -1.0), $MachinePrecision] * N[(N[Sqrt[x], $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -950000000 \lor \neg \left(y \leq 200000000\right):\\
\;\;\;\;\left(y + -1\right) \cdot \left(\sqrt{x} \cdot 3\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(-3 + \frac{0.3333333333333333}{x}\right)\\
\end{array}
\end{array}
if y < -9.5e8 or 2e8 < y Initial program 99.5%
Taylor expanded in y around inf 79.4%
if -9.5e8 < y < 2e8Initial 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.3%
associate-/l/99.3%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in y around 0 98.4%
associate-*r*98.4%
sub-neg98.4%
associate-*r/98.4%
metadata-eval98.4%
metadata-eval98.4%
distribute-rgt-in98.4%
associate-*l/98.5%
metadata-eval98.5%
metadata-eval98.5%
+-commutative98.5%
*-commutative98.5%
+-commutative98.5%
Simplified98.5%
Final simplification89.0%
(FPCore (x y)
:precision binary64
(if (<= y -12600000000.0)
(* 3.0 (* y (sqrt x)))
(if (<= y 72000000000.0)
(* (sqrt x) (+ -3.0 (/ 0.3333333333333333 x)))
(* (sqrt x) (- (* y 3.0) 3.0)))))
double code(double x, double y) {
double tmp;
if (y <= -12600000000.0) {
tmp = 3.0 * (y * sqrt(x));
} else if (y <= 72000000000.0) {
tmp = sqrt(x) * (-3.0 + (0.3333333333333333 / x));
} else {
tmp = sqrt(x) * ((y * 3.0) - 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 <= (-12600000000.0d0)) then
tmp = 3.0d0 * (y * sqrt(x))
else if (y <= 72000000000.0d0) then
tmp = sqrt(x) * ((-3.0d0) + (0.3333333333333333d0 / x))
else
tmp = sqrt(x) * ((y * 3.0d0) - 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -12600000000.0) {
tmp = 3.0 * (y * Math.sqrt(x));
} else if (y <= 72000000000.0) {
tmp = Math.sqrt(x) * (-3.0 + (0.3333333333333333 / x));
} else {
tmp = Math.sqrt(x) * ((y * 3.0) - 3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -12600000000.0: tmp = 3.0 * (y * math.sqrt(x)) elif y <= 72000000000.0: tmp = math.sqrt(x) * (-3.0 + (0.3333333333333333 / x)) else: tmp = math.sqrt(x) * ((y * 3.0) - 3.0) return tmp
function code(x, y) tmp = 0.0 if (y <= -12600000000.0) tmp = Float64(3.0 * Float64(y * sqrt(x))); elseif (y <= 72000000000.0) tmp = Float64(sqrt(x) * Float64(-3.0 + Float64(0.3333333333333333 / x))); else tmp = Float64(sqrt(x) * Float64(Float64(y * 3.0) - 3.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -12600000000.0) tmp = 3.0 * (y * sqrt(x)); elseif (y <= 72000000000.0) tmp = sqrt(x) * (-3.0 + (0.3333333333333333 / x)); else tmp = sqrt(x) * ((y * 3.0) - 3.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -12600000000.0], N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 72000000000.0], N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(y * 3.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -12600000000:\\
\;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{elif}\;y \leq 72000000000:\\
\;\;\;\;\sqrt{x} \cdot \left(-3 + \frac{0.3333333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3 - 3\right)\\
\end{array}
\end{array}
if y < -1.26e10Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.4%
associate-/l/99.4%
associate-/r/99.5%
Simplified99.5%
Taylor expanded in y around inf 74.2%
*-commutative74.2%
Simplified74.2%
if -1.26e10 < y < 7.2e10Initial 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.3%
associate-/l/99.3%
associate-/r/99.4%
Simplified99.4%
Taylor expanded in y around 0 98.4%
associate-*r*98.4%
sub-neg98.4%
associate-*r/98.4%
metadata-eval98.4%
metadata-eval98.4%
distribute-rgt-in98.4%
associate-*l/98.5%
metadata-eval98.5%
metadata-eval98.5%
+-commutative98.5%
*-commutative98.5%
+-commutative98.5%
Simplified98.5%
if 7.2e10 < y Initial 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.3%
distribute-rgt-neg-in99.3%
*-commutative99.3%
associate-/r*99.4%
associate-/r/99.4%
mul-1-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 85.0%
Final simplification88.9%
(FPCore (x y) :precision binary64 (* (sqrt x) (+ (* y 3.0) (+ -3.0 (/ 0.3333333333333333 x)))))
double code(double x, double y) {
return sqrt(x) * ((y * 3.0) + (-3.0 + (0.3333333333333333 / x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(x) * ((y * 3.0d0) + ((-3.0d0) + (0.3333333333333333d0 / x)))
end function
public static double code(double x, double y) {
return Math.sqrt(x) * ((y * 3.0) + (-3.0 + (0.3333333333333333 / x)));
}
def code(x, y): return math.sqrt(x) * ((y * 3.0) + (-3.0 + (0.3333333333333333 / x)))
function code(x, y) return Float64(sqrt(x) * Float64(Float64(y * 3.0) + Float64(-3.0 + Float64(0.3333333333333333 / x)))) end
function tmp = code(x, y) tmp = sqrt(x) * ((y * 3.0) + (-3.0 + (0.3333333333333333 / x))); end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(N[(y * 3.0), $MachinePrecision] + N[(-3.0 + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x} \cdot \left(y \cdot 3 + \left(-3 + \frac{0.3333333333333333}{x}\right)\right)
\end{array}
Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
distribute-lft-in99.4%
+-commutative99.4%
*-commutative99.4%
associate-*r*99.4%
cancel-sign-sub99.4%
*-commutative99.4%
associate-*r*99.0%
*-commutative99.0%
distribute-rgt-out--99.0%
distribute-lft-neg-in99.0%
cancel-sign-sub99.0%
+-commutative99.0%
*-commutative99.0%
distribute-rgt-in99.0%
Simplified99.0%
fma-udef99.1%
Applied egg-rr99.1%
Final simplification99.1%
(FPCore (x y) :precision binary64 (if (<= x 3.8e-11) (sqrt (+ (/ 0.1111111111111111 x) -2.0)) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if (x <= 3.8e-11) {
tmp = sqrt(((0.1111111111111111 / x) + -2.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) :: tmp
if (x <= 3.8d-11) then
tmp = sqrt(((0.1111111111111111d0 / x) + (-2.0d0)))
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 3.8e-11) {
tmp = Math.sqrt(((0.1111111111111111 / x) + -2.0));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 3.8e-11: tmp = math.sqrt(((0.1111111111111111 / x) + -2.0)) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 3.8e-11) tmp = sqrt(Float64(Float64(0.1111111111111111 / x) + -2.0)); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 3.8e-11) tmp = sqrt(((0.1111111111111111 / x) + -2.0)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 3.8e-11], N[Sqrt[N[(N[(0.1111111111111111 / x), $MachinePrecision] + -2.0), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.8 \cdot 10^{-11}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x} + -2}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 3.7999999999999998e-11Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
distribute-rgt-in99.3%
remove-double-neg99.3%
distribute-lft-neg-in99.3%
distribute-rgt-neg-in99.3%
mul-1-neg99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.3%
distribute-neg-frac99.3%
*-commutative99.3%
associate-/r/99.2%
associate-/l/99.2%
associate-/r/99.3%
Simplified99.4%
add-sqr-sqrt98.9%
pow298.9%
Applied egg-rr98.9%
Taylor expanded in y around 0 72.9%
associate-*l*73.0%
*-commutative73.0%
unpow273.0%
rem-square-sqrt73.7%
*-commutative73.7%
associate-*r*73.7%
*-commutative73.7%
associate-*l*73.7%
sub-neg73.7%
associate-*r/73.8%
metadata-eval73.8%
metadata-eval73.8%
+-commutative73.8%
Simplified73.8%
add-sqr-sqrt73.5%
sqrt-unprod73.8%
swap-sqr73.7%
metadata-eval73.7%
*-commutative73.7%
*-commutative73.7%
swap-sqr33.7%
add-sqr-sqrt33.7%
pow233.7%
+-commutative33.7%
Applied egg-rr33.7%
rem-square-sqrt33.7%
unpow233.7%
swap-sqr73.7%
*-commutative73.7%
metadata-eval73.7%
swap-sqr73.8%
*-commutative73.8%
*-commutative73.8%
associate-*r*73.7%
metadata-eval73.7%
associate-*r/73.7%
metadata-eval73.7%
sub-neg73.7%
*-commutative73.7%
*-commutative73.7%
associate-*r*73.7%
Simplified33.7%
Taylor expanded in x around 0 74.0%
sub-neg74.0%
associate-*r/74.0%
metadata-eval74.0%
metadata-eval74.0%
Simplified74.0%
if 3.7999999999999998e-11 < x Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.5%
associate-/l/99.5%
associate-/r/99.5%
Simplified99.5%
add-sqr-sqrt99.2%
pow299.2%
Applied egg-rr99.2%
Taylor expanded in y around 0 48.9%
*-commutative48.9%
*-commutative48.9%
unpow248.9%
rem-square-sqrt49.3%
sub-neg49.3%
associate-*r/49.3%
metadata-eval49.3%
metadata-eval49.3%
+-commutative49.3%
Simplified49.3%
Taylor expanded in x around inf 47.6%
Final simplification59.4%
(FPCore (x y) :precision binary64 (if (<= x 3.8e-11) (sqrt (/ 0.1111111111111111 x)) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if (x <= 3.8e-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 <= 3.8d-11) 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 <= 3.8e-11) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 3.8e-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 <= 3.8e-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 <= 3.8e-11) tmp = sqrt((0.1111111111111111 / x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 3.8e-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 3.8 \cdot 10^{-11}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 3.7999999999999998e-11Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
distribute-rgt-in99.3%
remove-double-neg99.3%
distribute-lft-neg-in99.3%
distribute-rgt-neg-in99.3%
mul-1-neg99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.3%
distribute-neg-frac99.3%
*-commutative99.3%
associate-/r/99.2%
associate-/l/99.2%
associate-/r/99.3%
Simplified99.4%
add-sqr-sqrt98.9%
pow298.9%
Applied egg-rr98.9%
Taylor expanded in y around 0 72.9%
associate-*l*73.0%
*-commutative73.0%
unpow273.0%
rem-square-sqrt73.7%
*-commutative73.7%
associate-*r*73.7%
*-commutative73.7%
associate-*l*73.7%
sub-neg73.7%
associate-*r/73.8%
metadata-eval73.8%
metadata-eval73.8%
+-commutative73.8%
Simplified73.8%
add-sqr-sqrt73.5%
sqrt-unprod73.8%
swap-sqr73.7%
metadata-eval73.7%
*-commutative73.7%
*-commutative73.7%
swap-sqr33.7%
add-sqr-sqrt33.7%
pow233.7%
+-commutative33.7%
Applied egg-rr33.7%
rem-square-sqrt33.7%
unpow233.7%
swap-sqr73.7%
*-commutative73.7%
metadata-eval73.7%
swap-sqr73.8%
*-commutative73.8%
*-commutative73.8%
associate-*r*73.7%
metadata-eval73.7%
associate-*r/73.7%
metadata-eval73.7%
sub-neg73.7%
*-commutative73.7%
*-commutative73.7%
associate-*r*73.7%
Simplified33.7%
Taylor expanded in x around 0 73.7%
if 3.7999999999999998e-11 < x Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
distribute-rgt-in99.5%
remove-double-neg99.5%
distribute-lft-neg-in99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.5%
associate-/l/99.5%
associate-/r/99.5%
Simplified99.5%
add-sqr-sqrt99.2%
pow299.2%
Applied egg-rr99.2%
Taylor expanded in y around 0 48.9%
*-commutative48.9%
*-commutative48.9%
unpow248.9%
rem-square-sqrt49.3%
sub-neg49.3%
associate-*r/49.3%
metadata-eval49.3%
metadata-eval49.3%
+-commutative49.3%
Simplified49.3%
Taylor expanded in x around inf 47.6%
Final simplification59.2%
(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%
+-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.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.4%
associate-/l/99.4%
associate-/r/99.5%
Simplified99.5%
add-sqr-sqrt99.1%
pow299.1%
Applied egg-rr99.1%
Taylor expanded in y around 0 59.6%
associate-*l*59.6%
*-commutative59.6%
unpow259.6%
rem-square-sqrt60.1%
*-commutative60.1%
associate-*r*60.1%
*-commutative60.1%
associate-*l*60.1%
sub-neg60.1%
associate-*r/60.2%
metadata-eval60.2%
metadata-eval60.2%
+-commutative60.2%
Simplified60.2%
add-sqr-sqrt32.7%
sqrt-unprod34.0%
swap-sqr33.9%
metadata-eval33.9%
*-commutative33.9%
*-commutative33.9%
swap-sqr16.1%
add-sqr-sqrt16.1%
pow216.1%
+-commutative16.1%
Applied egg-rr16.1%
rem-square-sqrt16.1%
unpow216.1%
swap-sqr33.9%
*-commutative33.9%
metadata-eval33.9%
swap-sqr34.0%
*-commutative34.0%
*-commutative34.0%
associate-*r*33.9%
metadata-eval33.9%
associate-*r/33.9%
metadata-eval33.9%
sub-neg33.9%
*-commutative33.9%
*-commutative33.9%
associate-*r*33.9%
Simplified16.1%
Taylor expanded in x around inf 3.1%
*-commutative3.1%
Simplified3.1%
Final simplification3.1%
(FPCore (x y) :precision binary64 (sqrt (/ 0.1111111111111111 x)))
double code(double x, double y) {
return sqrt((0.1111111111111111 / x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt((0.1111111111111111d0 / x))
end function
public static double code(double x, double y) {
return Math.sqrt((0.1111111111111111 / x));
}
def code(x, y): return math.sqrt((0.1111111111111111 / x))
function code(x, y) return sqrt(Float64(0.1111111111111111 / x)) end
function tmp = code(x, y) tmp = sqrt((0.1111111111111111 / x)); end
code[x_, y_] := N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{\frac{0.1111111111111111}{x}}
\end{array}
Initial program 99.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.5%
distribute-neg-frac99.5%
*-commutative99.5%
associate-/r/99.4%
associate-/l/99.4%
associate-/r/99.5%
Simplified99.5%
add-sqr-sqrt99.1%
pow299.1%
Applied egg-rr99.1%
Taylor expanded in y around 0 59.6%
associate-*l*59.6%
*-commutative59.6%
unpow259.6%
rem-square-sqrt60.1%
*-commutative60.1%
associate-*r*60.1%
*-commutative60.1%
associate-*l*60.1%
sub-neg60.1%
associate-*r/60.2%
metadata-eval60.2%
metadata-eval60.2%
+-commutative60.2%
Simplified60.2%
add-sqr-sqrt32.7%
sqrt-unprod34.0%
swap-sqr33.9%
metadata-eval33.9%
*-commutative33.9%
*-commutative33.9%
swap-sqr16.1%
add-sqr-sqrt16.1%
pow216.1%
+-commutative16.1%
Applied egg-rr16.1%
rem-square-sqrt16.1%
unpow216.1%
swap-sqr33.9%
*-commutative33.9%
metadata-eval33.9%
swap-sqr34.0%
*-commutative34.0%
*-commutative34.0%
associate-*r*33.9%
metadata-eval33.9%
associate-*r/33.9%
metadata-eval33.9%
sub-neg33.9%
*-commutative33.9%
*-commutative33.9%
associate-*r*33.9%
Simplified16.1%
Taylor expanded in x around 0 33.9%
Final simplification33.9%
(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 2023176
(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)))