
(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 16 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)) (+ (+ y (/ 1.0 (* x 9.0))) -1.0)))
double code(double x, double y) {
return sqrt((x * 9.0)) * ((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 = sqrt((x * 9.0d0)) * ((y + (1.0d0 / (x * 9.0d0))) + (-1.0d0))
end function
public static double code(double x, double y) {
return Math.sqrt((x * 9.0)) * ((y + (1.0 / (x * 9.0))) + -1.0);
}
def code(x, y): return math.sqrt((x * 9.0)) * ((y + (1.0 / (x * 9.0))) + -1.0)
function code(x, y) return Float64(sqrt(Float64(x * 9.0)) * Float64(Float64(y + Float64(1.0 / Float64(x * 9.0))) + -1.0)) end
function tmp = code(x, y) tmp = sqrt((x * 9.0)) * ((y + (1.0 / (x * 9.0))) + -1.0); end
code[x_, y_] := N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * N[(N[(y + N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x \cdot 9} \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) + -1\right)
\end{array}
Initial program 99.3%
*-commutative99.3%
metadata-eval99.3%
sqrt-prod99.5%
pow1/299.5%
Applied egg-rr99.5%
unpow1/299.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y)
:precision binary64
(if (<= x 2.5e-50)
(* 0.3333333333333333 (sqrt (/ 1.0 x)))
(if (or (<= x 2350000000000.0)
(and (not (<= x 1.18e+76))
(or (<= x 9e+106)
(and (not (<= x 9.2e+144)) (<= x 1.3e+206)))))
(* 3.0 (* y (sqrt x)))
(* (sqrt x) -3.0))))
double code(double x, double y) {
double tmp;
if (x <= 2.5e-50) {
tmp = 0.3333333333333333 * sqrt((1.0 / x));
} else if ((x <= 2350000000000.0) || (!(x <= 1.18e+76) && ((x <= 9e+106) || (!(x <= 9.2e+144) && (x <= 1.3e+206))))) {
tmp = 3.0 * (y * sqrt(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 <= 2.5d-50) then
tmp = 0.3333333333333333d0 * sqrt((1.0d0 / x))
else if ((x <= 2350000000000.0d0) .or. (.not. (x <= 1.18d+76)) .and. (x <= 9d+106) .or. (.not. (x <= 9.2d+144)) .and. (x <= 1.3d+206)) then
tmp = 3.0d0 * (y * sqrt(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 <= 2.5e-50) {
tmp = 0.3333333333333333 * Math.sqrt((1.0 / x));
} else if ((x <= 2350000000000.0) || (!(x <= 1.18e+76) && ((x <= 9e+106) || (!(x <= 9.2e+144) && (x <= 1.3e+206))))) {
tmp = 3.0 * (y * Math.sqrt(x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 2.5e-50: tmp = 0.3333333333333333 * math.sqrt((1.0 / x)) elif (x <= 2350000000000.0) or (not (x <= 1.18e+76) and ((x <= 9e+106) or (not (x <= 9.2e+144) and (x <= 1.3e+206)))): tmp = 3.0 * (y * math.sqrt(x)) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 2.5e-50) tmp = Float64(0.3333333333333333 * sqrt(Float64(1.0 / x))); elseif ((x <= 2350000000000.0) || (!(x <= 1.18e+76) && ((x <= 9e+106) || (!(x <= 9.2e+144) && (x <= 1.3e+206))))) tmp = Float64(3.0 * Float64(y * sqrt(x))); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 2.5e-50) tmp = 0.3333333333333333 * sqrt((1.0 / x)); elseif ((x <= 2350000000000.0) || (~((x <= 1.18e+76)) && ((x <= 9e+106) || (~((x <= 9.2e+144)) && (x <= 1.3e+206))))) tmp = 3.0 * (y * sqrt(x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 2.5e-50], N[(0.3333333333333333 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 2350000000000.0], And[N[Not[LessEqual[x, 1.18e+76]], $MachinePrecision], Or[LessEqual[x, 9e+106], And[N[Not[LessEqual[x, 9.2e+144]], $MachinePrecision], LessEqual[x, 1.3e+206]]]]], N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.5 \cdot 10^{-50}:\\
\;\;\;\;0.3333333333333333 \cdot \sqrt{\frac{1}{x}}\\
\mathbf{elif}\;x \leq 2350000000000 \lor \neg \left(x \leq 1.18 \cdot 10^{+76}\right) \land \left(x \leq 9 \cdot 10^{+106} \lor \neg \left(x \leq 9.2 \cdot 10^{+144}\right) \land x \leq 1.3 \cdot 10^{+206}\right):\\
\;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 2.49999999999999984e-50Initial program 99.2%
associate-*l*99.2%
sub-neg99.2%
+-commutative99.2%
associate-+l+99.2%
*-commutative99.2%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 99.2%
associate-*r*99.1%
associate-*r*99.2%
sub-neg99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
distribute-lft-out99.4%
*-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-*r*99.3%
distribute-lft-in99.2%
associate-*r/99.3%
metadata-eval99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 99.3%
Taylor expanded in y around 0 77.8%
if 2.49999999999999984e-50 < x < 2.35e12 or 1.17999999999999997e76 < x < 8.9999999999999994e106 or 9.2000000000000006e144 < x < 1.29999999999999994e206Initial program 99.4%
associate-*l*99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 61.1%
if 2.35e12 < x < 1.17999999999999997e76 or 8.9999999999999994e106 < x < 9.2000000000000006e144 or 1.29999999999999994e206 < x Initial program 99.4%
associate-*l*99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 70.3%
sub-neg70.3%
associate-*r/70.3%
metadata-eval70.3%
metadata-eval70.3%
Simplified70.3%
Taylor expanded in x around inf 70.1%
add070.1%
associate-*r*70.1%
fma-define70.1%
/-rgt-identity70.1%
div-inv70.1%
add-sqr-sqrt70.1%
metadata-eval70.1%
metadata-eval70.1%
swap-sqr70.1%
sqrt-unprod0.0%
add-sqr-sqrt1.8%
*-commutative1.8%
add-sqr-sqrt0.0%
sqrt-unprod70.1%
swap-sqr70.1%
add-sqr-sqrt70.1%
metadata-eval70.1%
metadata-eval70.1%
div-inv70.1%
/-rgt-identity70.1%
Applied egg-rr70.1%
fma-undefine70.1%
*-commutative70.1%
add070.1%
mul-1-neg70.1%
distribute-rgt-neg-in70.1%
metadata-eval70.1%
Simplified70.1%
Final simplification70.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sqrt x) -3.0)) (t_1 (* 3.0 (* y (sqrt x)))))
(if (<= x 1.5e-50)
(* 0.3333333333333333 (sqrt (/ 1.0 x)))
(if (<= x 2350000000000.0)
t_1
(if (<= x 1.3e+76)
t_0
(if (<= x 1.9e+111)
(* (sqrt (* x 9.0)) y)
(if (or (<= x 4e+144) (not (<= x 9.5e+206))) t_0 t_1)))))))
double code(double x, double y) {
double t_0 = sqrt(x) * -3.0;
double t_1 = 3.0 * (y * sqrt(x));
double tmp;
if (x <= 1.5e-50) {
tmp = 0.3333333333333333 * sqrt((1.0 / x));
} else if (x <= 2350000000000.0) {
tmp = t_1;
} else if (x <= 1.3e+76) {
tmp = t_0;
} else if (x <= 1.9e+111) {
tmp = sqrt((x * 9.0)) * y;
} else if ((x <= 4e+144) || !(x <= 9.5e+206)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt(x) * (-3.0d0)
t_1 = 3.0d0 * (y * sqrt(x))
if (x <= 1.5d-50) then
tmp = 0.3333333333333333d0 * sqrt((1.0d0 / x))
else if (x <= 2350000000000.0d0) then
tmp = t_1
else if (x <= 1.3d+76) then
tmp = t_0
else if (x <= 1.9d+111) then
tmp = sqrt((x * 9.0d0)) * y
else if ((x <= 4d+144) .or. (.not. (x <= 9.5d+206))) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt(x) * -3.0;
double t_1 = 3.0 * (y * Math.sqrt(x));
double tmp;
if (x <= 1.5e-50) {
tmp = 0.3333333333333333 * Math.sqrt((1.0 / x));
} else if (x <= 2350000000000.0) {
tmp = t_1;
} else if (x <= 1.3e+76) {
tmp = t_0;
} else if (x <= 1.9e+111) {
tmp = Math.sqrt((x * 9.0)) * y;
} else if ((x <= 4e+144) || !(x <= 9.5e+206)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y): t_0 = math.sqrt(x) * -3.0 t_1 = 3.0 * (y * math.sqrt(x)) tmp = 0 if x <= 1.5e-50: tmp = 0.3333333333333333 * math.sqrt((1.0 / x)) elif x <= 2350000000000.0: tmp = t_1 elif x <= 1.3e+76: tmp = t_0 elif x <= 1.9e+111: tmp = math.sqrt((x * 9.0)) * y elif (x <= 4e+144) or not (x <= 9.5e+206): tmp = t_0 else: tmp = t_1 return tmp
function code(x, y) t_0 = Float64(sqrt(x) * -3.0) t_1 = Float64(3.0 * Float64(y * sqrt(x))) tmp = 0.0 if (x <= 1.5e-50) tmp = Float64(0.3333333333333333 * sqrt(Float64(1.0 / x))); elseif (x <= 2350000000000.0) tmp = t_1; elseif (x <= 1.3e+76) tmp = t_0; elseif (x <= 1.9e+111) tmp = Float64(sqrt(Float64(x * 9.0)) * y); elseif ((x <= 4e+144) || !(x <= 9.5e+206)) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt(x) * -3.0; t_1 = 3.0 * (y * sqrt(x)); tmp = 0.0; if (x <= 1.5e-50) tmp = 0.3333333333333333 * sqrt((1.0 / x)); elseif (x <= 2350000000000.0) tmp = t_1; elseif (x <= 1.3e+76) tmp = t_0; elseif (x <= 1.9e+111) tmp = sqrt((x * 9.0)) * y; elseif ((x <= 4e+144) || ~((x <= 9.5e+206))) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]}, Block[{t$95$1 = N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.5e-50], N[(0.3333333333333333 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2350000000000.0], t$95$1, If[LessEqual[x, 1.3e+76], t$95$0, If[LessEqual[x, 1.9e+111], N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision], If[Or[LessEqual[x, 4e+144], N[Not[LessEqual[x, 9.5e+206]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x} \cdot -3\\
t_1 := 3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{if}\;x \leq 1.5 \cdot 10^{-50}:\\
\;\;\;\;0.3333333333333333 \cdot \sqrt{\frac{1}{x}}\\
\mathbf{elif}\;x \leq 2350000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+76}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+111}:\\
\;\;\;\;\sqrt{x \cdot 9} \cdot y\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+144} \lor \neg \left(x \leq 9.5 \cdot 10^{+206}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < 1.49999999999999995e-50Initial program 99.2%
associate-*l*99.2%
sub-neg99.2%
+-commutative99.2%
associate-+l+99.2%
*-commutative99.2%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 99.2%
associate-*r*99.1%
associate-*r*99.2%
sub-neg99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
distribute-lft-out99.4%
*-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-*r*99.3%
distribute-lft-in99.2%
associate-*r/99.3%
metadata-eval99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 99.3%
Taylor expanded in y around 0 77.8%
if 1.49999999999999995e-50 < x < 2.35e12 or 4.00000000000000009e144 < x < 9.49999999999999966e206Initial program 99.4%
associate-*l*99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 56.8%
if 2.35e12 < x < 1.3e76 or 1.89999999999999988e111 < x < 4.00000000000000009e144 or 9.49999999999999966e206 < x Initial program 99.4%
associate-*l*99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 70.8%
sub-neg70.8%
associate-*r/70.8%
metadata-eval70.8%
metadata-eval70.8%
Simplified70.8%
Taylor expanded in x around inf 70.7%
add070.7%
associate-*r*70.7%
fma-define70.7%
/-rgt-identity70.7%
div-inv70.7%
add-sqr-sqrt70.7%
metadata-eval70.7%
metadata-eval70.7%
swap-sqr70.7%
sqrt-unprod0.0%
add-sqr-sqrt1.8%
*-commutative1.8%
add-sqr-sqrt0.0%
sqrt-unprod70.7%
swap-sqr70.7%
add-sqr-sqrt70.7%
metadata-eval70.7%
metadata-eval70.7%
div-inv70.7%
/-rgt-identity70.7%
Applied egg-rr70.7%
fma-undefine70.7%
*-commutative70.7%
add070.7%
mul-1-neg70.7%
distribute-rgt-neg-in70.7%
metadata-eval70.7%
Simplified70.7%
if 1.3e76 < x < 1.89999999999999988e111Initial program 99.6%
associate-*l*99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 78.3%
add078.3%
*-commutative78.3%
*-commutative78.3%
associate-*l*78.5%
metadata-eval78.5%
sqrt-prod78.5%
Applied egg-rr78.5%
add078.5%
Simplified78.5%
Final simplification70.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sqrt x) -3.0)))
(if (<= x 7.2e-51)
(* 0.3333333333333333 (sqrt (/ 1.0 x)))
(if (<= x 2350000000000.0)
(* 3.0 (* y (sqrt x)))
(if (<= x 1.12e+77)
t_0
(if (<= x 1.9e+111)
(* (sqrt (* x 9.0)) y)
(if (or (<= x 4.4e+143) (not (<= x 1.65e+206)))
t_0
(* (sqrt x) (* y 3.0)))))))))
double code(double x, double y) {
double t_0 = sqrt(x) * -3.0;
double tmp;
if (x <= 7.2e-51) {
tmp = 0.3333333333333333 * sqrt((1.0 / x));
} else if (x <= 2350000000000.0) {
tmp = 3.0 * (y * sqrt(x));
} else if (x <= 1.12e+77) {
tmp = t_0;
} else if (x <= 1.9e+111) {
tmp = sqrt((x * 9.0)) * y;
} else if ((x <= 4.4e+143) || !(x <= 1.65e+206)) {
tmp = t_0;
} else {
tmp = sqrt(x) * (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) * (-3.0d0)
if (x <= 7.2d-51) then
tmp = 0.3333333333333333d0 * sqrt((1.0d0 / x))
else if (x <= 2350000000000.0d0) then
tmp = 3.0d0 * (y * sqrt(x))
else if (x <= 1.12d+77) then
tmp = t_0
else if (x <= 1.9d+111) then
tmp = sqrt((x * 9.0d0)) * y
else if ((x <= 4.4d+143) .or. (.not. (x <= 1.65d+206))) then
tmp = t_0
else
tmp = sqrt(x) * (y * 3.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 (x <= 7.2e-51) {
tmp = 0.3333333333333333 * Math.sqrt((1.0 / x));
} else if (x <= 2350000000000.0) {
tmp = 3.0 * (y * Math.sqrt(x));
} else if (x <= 1.12e+77) {
tmp = t_0;
} else if (x <= 1.9e+111) {
tmp = Math.sqrt((x * 9.0)) * y;
} else if ((x <= 4.4e+143) || !(x <= 1.65e+206)) {
tmp = t_0;
} else {
tmp = Math.sqrt(x) * (y * 3.0);
}
return tmp;
}
def code(x, y): t_0 = math.sqrt(x) * -3.0 tmp = 0 if x <= 7.2e-51: tmp = 0.3333333333333333 * math.sqrt((1.0 / x)) elif x <= 2350000000000.0: tmp = 3.0 * (y * math.sqrt(x)) elif x <= 1.12e+77: tmp = t_0 elif x <= 1.9e+111: tmp = math.sqrt((x * 9.0)) * y elif (x <= 4.4e+143) or not (x <= 1.65e+206): tmp = t_0 else: tmp = math.sqrt(x) * (y * 3.0) return tmp
function code(x, y) t_0 = Float64(sqrt(x) * -3.0) tmp = 0.0 if (x <= 7.2e-51) tmp = Float64(0.3333333333333333 * sqrt(Float64(1.0 / x))); elseif (x <= 2350000000000.0) tmp = Float64(3.0 * Float64(y * sqrt(x))); elseif (x <= 1.12e+77) tmp = t_0; elseif (x <= 1.9e+111) tmp = Float64(sqrt(Float64(x * 9.0)) * y); elseif ((x <= 4.4e+143) || !(x <= 1.65e+206)) tmp = t_0; else tmp = Float64(sqrt(x) * Float64(y * 3.0)); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt(x) * -3.0; tmp = 0.0; if (x <= 7.2e-51) tmp = 0.3333333333333333 * sqrt((1.0 / x)); elseif (x <= 2350000000000.0) tmp = 3.0 * (y * sqrt(x)); elseif (x <= 1.12e+77) tmp = t_0; elseif (x <= 1.9e+111) tmp = sqrt((x * 9.0)) * y; elseif ((x <= 4.4e+143) || ~((x <= 1.65e+206))) tmp = t_0; else tmp = sqrt(x) * (y * 3.0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]}, If[LessEqual[x, 7.2e-51], N[(0.3333333333333333 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2350000000000.0], N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.12e+77], t$95$0, If[LessEqual[x, 1.9e+111], N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision], If[Or[LessEqual[x, 4.4e+143], N[Not[LessEqual[x, 1.65e+206]], $MachinePrecision]], t$95$0, N[(N[Sqrt[x], $MachinePrecision] * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x} \cdot -3\\
\mathbf{if}\;x \leq 7.2 \cdot 10^{-51}:\\
\;\;\;\;0.3333333333333333 \cdot \sqrt{\frac{1}{x}}\\
\mathbf{elif}\;x \leq 2350000000000:\\
\;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{+77}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+111}:\\
\;\;\;\;\sqrt{x \cdot 9} \cdot y\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+143} \lor \neg \left(x \leq 1.65 \cdot 10^{+206}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\
\end{array}
\end{array}
if x < 7.2000000000000001e-51Initial program 99.2%
associate-*l*99.2%
sub-neg99.2%
+-commutative99.2%
associate-+l+99.2%
*-commutative99.2%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 99.2%
associate-*r*99.1%
associate-*r*99.2%
sub-neg99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
distribute-lft-out99.4%
*-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-*r*99.3%
distribute-lft-in99.2%
associate-*r/99.3%
metadata-eval99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 99.3%
Taylor expanded in y around 0 77.8%
if 7.2000000000000001e-51 < x < 2.35e12Initial program 99.2%
associate-*l*99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around inf 53.2%
if 2.35e12 < x < 1.1199999999999999e77 or 1.89999999999999988e111 < x < 4.40000000000000028e143 or 1.64999999999999992e206 < x Initial program 99.4%
associate-*l*99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 70.8%
sub-neg70.8%
associate-*r/70.8%
metadata-eval70.8%
metadata-eval70.8%
Simplified70.8%
Taylor expanded in x around inf 70.7%
add070.7%
associate-*r*70.7%
fma-define70.7%
/-rgt-identity70.7%
div-inv70.7%
add-sqr-sqrt70.7%
metadata-eval70.7%
metadata-eval70.7%
swap-sqr70.7%
sqrt-unprod0.0%
add-sqr-sqrt1.8%
*-commutative1.8%
add-sqr-sqrt0.0%
sqrt-unprod70.7%
swap-sqr70.7%
add-sqr-sqrt70.7%
metadata-eval70.7%
metadata-eval70.7%
div-inv70.7%
/-rgt-identity70.7%
Applied egg-rr70.7%
fma-undefine70.7%
*-commutative70.7%
add070.7%
mul-1-neg70.7%
distribute-rgt-neg-in70.7%
metadata-eval70.7%
Simplified70.7%
if 1.1199999999999999e77 < x < 1.89999999999999988e111Initial program 99.6%
associate-*l*99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 78.3%
add078.3%
*-commutative78.3%
*-commutative78.3%
associate-*l*78.5%
metadata-eval78.5%
sqrt-prod78.5%
Applied egg-rr78.5%
add078.5%
Simplified78.5%
if 4.40000000000000028e143 < x < 1.64999999999999992e206Initial program 99.6%
associate-*l*99.6%
sub-neg99.6%
+-commutative99.6%
associate-+l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 99.6%
associate-*r*99.6%
associate-*r*99.6%
sub-neg99.6%
associate-*r/99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-out99.6%
*-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
associate-*r*99.7%
distribute-lft-in99.7%
associate-*r/99.7%
metadata-eval99.7%
+-commutative99.7%
distribute-lft-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 60.7%
*-commutative60.7%
associate-*l*60.7%
*-commutative60.7%
Simplified60.7%
Final simplification70.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sqrt x) -3.0)))
(if (<= x 6.5e-51)
(* 3.0 (* (sqrt x) (/ 0.1111111111111111 x)))
(if (<= x 2350000000000.0)
(* 3.0 (* y (sqrt x)))
(if (<= x 6e+75)
t_0
(if (<= x 2.05e+111)
(* (sqrt (* x 9.0)) y)
(if (or (<= x 4.1e+144) (not (<= x 3.2e+206)))
t_0
(* (sqrt x) (* y 3.0)))))))))
double code(double x, double y) {
double t_0 = sqrt(x) * -3.0;
double tmp;
if (x <= 6.5e-51) {
tmp = 3.0 * (sqrt(x) * (0.1111111111111111 / x));
} else if (x <= 2350000000000.0) {
tmp = 3.0 * (y * sqrt(x));
} else if (x <= 6e+75) {
tmp = t_0;
} else if (x <= 2.05e+111) {
tmp = sqrt((x * 9.0)) * y;
} else if ((x <= 4.1e+144) || !(x <= 3.2e+206)) {
tmp = t_0;
} else {
tmp = sqrt(x) * (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) * (-3.0d0)
if (x <= 6.5d-51) then
tmp = 3.0d0 * (sqrt(x) * (0.1111111111111111d0 / x))
else if (x <= 2350000000000.0d0) then
tmp = 3.0d0 * (y * sqrt(x))
else if (x <= 6d+75) then
tmp = t_0
else if (x <= 2.05d+111) then
tmp = sqrt((x * 9.0d0)) * y
else if ((x <= 4.1d+144) .or. (.not. (x <= 3.2d+206))) then
tmp = t_0
else
tmp = sqrt(x) * (y * 3.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 (x <= 6.5e-51) {
tmp = 3.0 * (Math.sqrt(x) * (0.1111111111111111 / x));
} else if (x <= 2350000000000.0) {
tmp = 3.0 * (y * Math.sqrt(x));
} else if (x <= 6e+75) {
tmp = t_0;
} else if (x <= 2.05e+111) {
tmp = Math.sqrt((x * 9.0)) * y;
} else if ((x <= 4.1e+144) || !(x <= 3.2e+206)) {
tmp = t_0;
} else {
tmp = Math.sqrt(x) * (y * 3.0);
}
return tmp;
}
def code(x, y): t_0 = math.sqrt(x) * -3.0 tmp = 0 if x <= 6.5e-51: tmp = 3.0 * (math.sqrt(x) * (0.1111111111111111 / x)) elif x <= 2350000000000.0: tmp = 3.0 * (y * math.sqrt(x)) elif x <= 6e+75: tmp = t_0 elif x <= 2.05e+111: tmp = math.sqrt((x * 9.0)) * y elif (x <= 4.1e+144) or not (x <= 3.2e+206): tmp = t_0 else: tmp = math.sqrt(x) * (y * 3.0) return tmp
function code(x, y) t_0 = Float64(sqrt(x) * -3.0) tmp = 0.0 if (x <= 6.5e-51) tmp = Float64(3.0 * Float64(sqrt(x) * Float64(0.1111111111111111 / x))); elseif (x <= 2350000000000.0) tmp = Float64(3.0 * Float64(y * sqrt(x))); elseif (x <= 6e+75) tmp = t_0; elseif (x <= 2.05e+111) tmp = Float64(sqrt(Float64(x * 9.0)) * y); elseif ((x <= 4.1e+144) || !(x <= 3.2e+206)) tmp = t_0; else tmp = Float64(sqrt(x) * Float64(y * 3.0)); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt(x) * -3.0; tmp = 0.0; if (x <= 6.5e-51) tmp = 3.0 * (sqrt(x) * (0.1111111111111111 / x)); elseif (x <= 2350000000000.0) tmp = 3.0 * (y * sqrt(x)); elseif (x <= 6e+75) tmp = t_0; elseif (x <= 2.05e+111) tmp = sqrt((x * 9.0)) * y; elseif ((x <= 4.1e+144) || ~((x <= 3.2e+206))) tmp = t_0; else tmp = sqrt(x) * (y * 3.0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]}, If[LessEqual[x, 6.5e-51], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2350000000000.0], N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e+75], t$95$0, If[LessEqual[x, 2.05e+111], N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision], If[Or[LessEqual[x, 4.1e+144], N[Not[LessEqual[x, 3.2e+206]], $MachinePrecision]], t$95$0, N[(N[Sqrt[x], $MachinePrecision] * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x} \cdot -3\\
\mathbf{if}\;x \leq 6.5 \cdot 10^{-51}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot \frac{0.1111111111111111}{x}\right)\\
\mathbf{elif}\;x \leq 2350000000000:\\
\;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+75}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+111}:\\
\;\;\;\;\sqrt{x \cdot 9} \cdot y\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{+144} \lor \neg \left(x \leq 3.2 \cdot 10^{+206}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\
\end{array}
\end{array}
if x < 6.5000000000000003e-51Initial program 99.2%
associate-*l*99.2%
sub-neg99.2%
+-commutative99.2%
associate-+l+99.2%
*-commutative99.2%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 77.8%
sub-neg77.8%
associate-*r/77.9%
metadata-eval77.9%
metadata-eval77.9%
Simplified77.9%
Taylor expanded in x around 0 77.9%
if 6.5000000000000003e-51 < x < 2.35e12Initial program 99.2%
associate-*l*99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.2%
metadata-eval99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around inf 53.2%
if 2.35e12 < x < 6e75 or 2.04999999999999993e111 < x < 4.10000000000000001e144 or 3.20000000000000005e206 < x Initial program 99.4%
associate-*l*99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 70.8%
sub-neg70.8%
associate-*r/70.8%
metadata-eval70.8%
metadata-eval70.8%
Simplified70.8%
Taylor expanded in x around inf 70.7%
add070.7%
associate-*r*70.7%
fma-define70.7%
/-rgt-identity70.7%
div-inv70.7%
add-sqr-sqrt70.7%
metadata-eval70.7%
metadata-eval70.7%
swap-sqr70.7%
sqrt-unprod0.0%
add-sqr-sqrt1.8%
*-commutative1.8%
add-sqr-sqrt0.0%
sqrt-unprod70.7%
swap-sqr70.7%
add-sqr-sqrt70.7%
metadata-eval70.7%
metadata-eval70.7%
div-inv70.7%
/-rgt-identity70.7%
Applied egg-rr70.7%
fma-undefine70.7%
*-commutative70.7%
add070.7%
mul-1-neg70.7%
distribute-rgt-neg-in70.7%
metadata-eval70.7%
Simplified70.7%
if 6e75 < x < 2.04999999999999993e111Initial program 99.6%
associate-*l*99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 78.3%
add078.3%
*-commutative78.3%
*-commutative78.3%
associate-*l*78.5%
metadata-eval78.5%
sqrt-prod78.5%
Applied egg-rr78.5%
add078.5%
Simplified78.5%
if 4.10000000000000001e144 < x < 3.20000000000000005e206Initial program 99.6%
associate-*l*99.6%
sub-neg99.6%
+-commutative99.6%
associate-+l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 99.6%
associate-*r*99.6%
associate-*r*99.6%
sub-neg99.6%
associate-*r/99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-out99.6%
*-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
associate-*r*99.7%
distribute-lft-in99.7%
associate-*r/99.7%
metadata-eval99.7%
+-commutative99.7%
distribute-lft-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 60.7%
*-commutative60.7%
associate-*l*60.7%
*-commutative60.7%
Simplified60.7%
Final simplification70.8%
(FPCore (x y) :precision binary64 (if (or (<= y -1.3e-33) (not (<= y 1e-10))) (* (sqrt x) (+ (/ 0.3333333333333333 x) (* y 3.0))) (* (sqrt x) (- (* 0.3333333333333333 (/ 1.0 x)) 3.0))))
double code(double x, double y) {
double tmp;
if ((y <= -1.3e-33) || !(y <= 1e-10)) {
tmp = sqrt(x) * ((0.3333333333333333 / x) + (y * 3.0));
} else {
tmp = sqrt(x) * ((0.3333333333333333 * (1.0 / x)) - 3.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-1.3d-33)) .or. (.not. (y <= 1d-10))) then
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (y * 3.0d0))
else
tmp = sqrt(x) * ((0.3333333333333333d0 * (1.0d0 / x)) - 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.3e-33) || !(y <= 1e-10)) {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + (y * 3.0));
} else {
tmp = Math.sqrt(x) * ((0.3333333333333333 * (1.0 / x)) - 3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.3e-33) or not (y <= 1e-10): tmp = math.sqrt(x) * ((0.3333333333333333 / x) + (y * 3.0)) else: tmp = math.sqrt(x) * ((0.3333333333333333 * (1.0 / x)) - 3.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.3e-33) || !(y <= 1e-10)) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + Float64(y * 3.0))); else tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 * Float64(1.0 / x)) - 3.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.3e-33) || ~((y <= 1e-10))) tmp = sqrt(x) * ((0.3333333333333333 / x) + (y * 3.0)); else tmp = sqrt(x) * ((0.3333333333333333 * (1.0 / x)) - 3.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.3e-33], N[Not[LessEqual[y, 1e-10]], $MachinePrecision]], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-33} \lor \neg \left(y \leq 10^{-10}\right):\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + y \cdot 3\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(0.3333333333333333 \cdot \frac{1}{x} - 3\right)\\
\end{array}
\end{array}
if y < -1.29999999999999997e-33 or 1.00000000000000004e-10 < y Initial program 99.3%
associate-*l*99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 99.4%
associate-*r*99.3%
associate-*r*99.3%
sub-neg99.3%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
distribute-lft-out99.4%
*-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-*r*99.4%
distribute-lft-in99.3%
associate-*r/99.4%
metadata-eval99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 99.4%
if -1.29999999999999997e-33 < y < 1.00000000000000004e-10Initial program 99.4%
associate-*l*99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 99.3%
associate-*r*99.3%
associate-*r*99.3%
sub-neg99.3%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-out99.4%
*-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-*r*99.4%
distribute-lft-in99.4%
associate-*r/99.4%
metadata-eval99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 99.5%
Final simplification99.4%
(FPCore (x y) :precision binary64 (if (or (<= y -1.3e-33) (not (<= y 1.0))) (* (sqrt x) (+ (/ 0.3333333333333333 x) (* y 3.0))) (* (sqrt (* x 9.0)) (+ (/ 0.1111111111111111 x) -1.0))))
double code(double x, double y) {
double tmp;
if ((y <= -1.3e-33) || !(y <= 1.0)) {
tmp = sqrt(x) * ((0.3333333333333333 / x) + (y * 3.0));
} else {
tmp = sqrt((x * 9.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) :: tmp
if ((y <= (-1.3d-33)) .or. (.not. (y <= 1.0d0))) then
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (y * 3.0d0))
else
tmp = sqrt((x * 9.0d0)) * ((0.1111111111111111d0 / x) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.3e-33) || !(y <= 1.0)) {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + (y * 3.0));
} else {
tmp = Math.sqrt((x * 9.0)) * ((0.1111111111111111 / x) + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.3e-33) or not (y <= 1.0): tmp = math.sqrt(x) * ((0.3333333333333333 / x) + (y * 3.0)) else: tmp = math.sqrt((x * 9.0)) * ((0.1111111111111111 / x) + -1.0) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.3e-33) || !(y <= 1.0)) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + Float64(y * 3.0))); else tmp = Float64(sqrt(Float64(x * 9.0)) * Float64(Float64(0.1111111111111111 / x) + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.3e-33) || ~((y <= 1.0))) tmp = sqrt(x) * ((0.3333333333333333 / x) + (y * 3.0)); else tmp = sqrt((x * 9.0)) * ((0.1111111111111111 / x) + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.3e-33], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * N[(N[(0.1111111111111111 / x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{-33} \lor \neg \left(y \leq 1\right):\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + y \cdot 3\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x \cdot 9} \cdot \left(\frac{0.1111111111111111}{x} + -1\right)\\
\end{array}
\end{array}
if y < -1.29999999999999997e-33 or 1 < y Initial program 99.3%
associate-*l*99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 99.4%
associate-*r*99.3%
associate-*r*99.3%
sub-neg99.3%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
distribute-lft-out99.4%
*-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-*r*99.4%
distribute-lft-in99.3%
associate-*r/99.4%
metadata-eval99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 99.4%
if -1.29999999999999997e-33 < y < 1Initial program 99.4%
associate-*l*99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 99.3%
sub-neg99.3%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
add099.3%
*-commutative99.3%
*-commutative99.3%
associate-*l*99.4%
metadata-eval99.4%
sqrt-prod99.6%
Applied egg-rr99.6%
add099.6%
Simplified99.6%
Final simplification99.5%
(FPCore (x y)
:precision binary64
(if (<= y -1.8e+48)
(* 3.0 (* y (sqrt x)))
(if (<= y 3.2e+74)
(* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))
(* (sqrt x) (* y 3.0)))))
double code(double x, double y) {
double tmp;
if (y <= -1.8e+48) {
tmp = 3.0 * (y * sqrt(x));
} else if (y <= 3.2e+74) {
tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = sqrt(x) * (y * 3.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.8d+48)) then
tmp = 3.0d0 * (y * sqrt(x))
else if (y <= 3.2d+74) then
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
else
tmp = sqrt(x) * (y * 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.8e+48) {
tmp = 3.0 * (y * Math.sqrt(x));
} else if (y <= 3.2e+74) {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = Math.sqrt(x) * (y * 3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.8e+48: tmp = 3.0 * (y * math.sqrt(x)) elif y <= 3.2e+74: tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0) else: tmp = math.sqrt(x) * (y * 3.0) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.8e+48) tmp = Float64(3.0 * Float64(y * sqrt(x))); elseif (y <= 3.2e+74) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0)); else tmp = Float64(sqrt(x) * Float64(y * 3.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.8e+48) tmp = 3.0 * (y * sqrt(x)); elseif (y <= 3.2e+74) tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0); else tmp = sqrt(x) * (y * 3.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.8e+48], N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+74], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+48}:\\
\;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+74}:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\
\end{array}
\end{array}
if y < -1.79999999999999992e48Initial program 99.3%
associate-*l*99.6%
sub-neg99.6%
+-commutative99.6%
associate-+l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 83.8%
if -1.79999999999999992e48 < y < 3.19999999999999995e74Initial program 99.3%
associate-*l*99.2%
sub-neg99.2%
+-commutative99.2%
associate-+l+99.2%
*-commutative99.2%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 93.6%
associate-*r*93.7%
sub-neg93.7%
associate-*r/93.8%
metadata-eval93.8%
metadata-eval93.8%
distribute-rgt-in93.8%
*-commutative93.8%
associate-*l*93.7%
*-commutative93.7%
associate-*r*93.7%
associate-*r*93.7%
distribute-rgt-out93.7%
associate-*r/93.7%
metadata-eval93.7%
metadata-eval93.7%
Simplified93.7%
if 3.19999999999999995e74 < y Initial program 99.4%
associate-*l*99.5%
sub-neg99.5%
+-commutative99.5%
associate-+l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 99.4%
associate-*r*99.4%
associate-*r*99.4%
sub-neg99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-out99.4%
*-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-*r*99.4%
distribute-lft-in99.4%
associate-*r/99.5%
metadata-eval99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 84.6%
*-commutative84.6%
associate-*l*84.6%
*-commutative84.6%
Simplified84.6%
Final simplification90.1%
(FPCore (x y) :precision binary64 (if (<= x 0.11) (* (sqrt x) (+ (/ 0.3333333333333333 x) (* y 3.0))) (* (sqrt (* x 9.0)) (+ y -1.0))))
double code(double x, double y) {
double tmp;
if (x <= 0.11) {
tmp = sqrt(x) * ((0.3333333333333333 / x) + (y * 3.0));
} else {
tmp = sqrt((x * 9.0)) * (y + -1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 0.11d0) then
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (y * 3.0d0))
else
tmp = sqrt((x * 9.0d0)) * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.11) {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + (y * 3.0));
} else {
tmp = Math.sqrt((x * 9.0)) * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.11: tmp = math.sqrt(x) * ((0.3333333333333333 / x) + (y * 3.0)) else: tmp = math.sqrt((x * 9.0)) * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.11) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + Float64(y * 3.0))); else tmp = Float64(sqrt(Float64(x * 9.0)) * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.11) tmp = sqrt(x) * ((0.3333333333333333 / x) + (y * 3.0)); else tmp = sqrt((x * 9.0)) * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.11], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.11:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + y \cdot 3\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x \cdot 9} \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < 0.110000000000000001Initial program 99.2%
associate-*l*99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 99.2%
associate-*r*99.2%
associate-*r*99.2%
sub-neg99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
distribute-lft-out99.3%
*-commutative99.3%
associate-+r+99.3%
+-commutative99.3%
associate-+r+99.3%
associate-*r*99.2%
distribute-lft-in99.2%
associate-*r/99.3%
metadata-eval99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 97.2%
if 0.110000000000000001 < x Initial program 99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in y around inf 98.5%
Final simplification97.8%
(FPCore (x y) :precision binary64 (if (<= x 6.5e-51) (* 3.0 (* (sqrt x) (/ 0.1111111111111111 x))) (* (sqrt x) (+ -3.0 (* y 3.0)))))
double code(double x, double y) {
double tmp;
if (x <= 6.5e-51) {
tmp = 3.0 * (sqrt(x) * (0.1111111111111111 / x));
} 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) :: tmp
if (x <= 6.5d-51) then
tmp = 3.0d0 * (sqrt(x) * (0.1111111111111111d0 / x))
else
tmp = sqrt(x) * ((-3.0d0) + (y * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 6.5e-51) {
tmp = 3.0 * (Math.sqrt(x) * (0.1111111111111111 / x));
} else {
tmp = Math.sqrt(x) * (-3.0 + (y * 3.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 6.5e-51: tmp = 3.0 * (math.sqrt(x) * (0.1111111111111111 / x)) else: tmp = math.sqrt(x) * (-3.0 + (y * 3.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 6.5e-51) tmp = Float64(3.0 * Float64(sqrt(x) * Float64(0.1111111111111111 / x))); else tmp = Float64(sqrt(x) * Float64(-3.0 + Float64(y * 3.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 6.5e-51) tmp = 3.0 * (sqrt(x) * (0.1111111111111111 / x)); else tmp = sqrt(x) * (-3.0 + (y * 3.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 6.5e-51], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 + N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.5 \cdot 10^{-51}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot \frac{0.1111111111111111}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(-3 + y \cdot 3\right)\\
\end{array}
\end{array}
if x < 6.5000000000000003e-51Initial program 99.2%
associate-*l*99.2%
sub-neg99.2%
+-commutative99.2%
associate-+l+99.2%
*-commutative99.2%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 77.8%
sub-neg77.8%
associate-*r/77.9%
metadata-eval77.9%
metadata-eval77.9%
Simplified77.9%
Taylor expanded in x around 0 77.9%
if 6.5000000000000003e-51 < x Initial program 99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
sqrt-prod99.4%
metadata-eval99.4%
*-commutative99.4%
*-commutative99.4%
pow1/299.4%
metadata-eval99.4%
pow-div99.3%
pow199.3%
pow1/299.3%
associate-*r/99.4%
associate-*r/93.1%
associate--l+93.1%
*-commutative93.1%
associate-/r*93.1%
metadata-eval93.1%
associate--l+93.1%
sub-neg93.1%
metadata-eval93.1%
associate-+l+93.1%
Applied egg-rr93.1%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in x around inf 89.4%
Taylor expanded in y around 0 89.6%
associate-*r*89.5%
*-commutative89.5%
associate-*r*89.6%
distribute-rgt-out89.6%
*-commutative89.6%
Simplified89.6%
Final simplification84.6%
(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.3%
associate-*l*99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y) :precision binary64 (* (sqrt x) (+ (/ 0.3333333333333333 x) (+ -3.0 (* y 3.0)))))
double code(double x, double y) {
return sqrt(x) * ((0.3333333333333333 / x) + (-3.0 + (y * 3.0)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(x) * ((0.3333333333333333d0 / x) + ((-3.0d0) + (y * 3.0d0)))
end function
public static double code(double x, double y) {
return Math.sqrt(x) * ((0.3333333333333333 / x) + (-3.0 + (y * 3.0)));
}
def code(x, y): return math.sqrt(x) * ((0.3333333333333333 / x) + (-3.0 + (y * 3.0)))
function code(x, y) return Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + Float64(-3.0 + Float64(y * 3.0)))) end
function tmp = code(x, y) tmp = sqrt(x) * ((0.3333333333333333 / x) + (-3.0 + (y * 3.0))); end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + N[(-3.0 + N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + \left(-3 + y \cdot 3\right)\right)
\end{array}
Initial program 99.3%
associate-*l*99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 99.3%
associate-*r*99.3%
associate-*r*99.3%
sub-neg99.3%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-out99.4%
*-commutative99.4%
associate-+r+99.4%
+-commutative99.4%
associate-+r+99.4%
associate-*r*99.4%
distribute-lft-in99.4%
associate-*r/99.4%
metadata-eval99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y) :precision binary64 (* (* 3.0 (sqrt x)) (+ (+ y (/ 0.1111111111111111 x)) -1.0)))
double code(double x, double y) {
return (3.0 * sqrt(x)) * ((y + (0.1111111111111111 / x)) + -1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (3.0d0 * sqrt(x)) * ((y + (0.1111111111111111d0 / x)) + (-1.0d0))
end function
public static double code(double x, double y) {
return (3.0 * Math.sqrt(x)) * ((y + (0.1111111111111111 / x)) + -1.0);
}
def code(x, y): return (3.0 * math.sqrt(x)) * ((y + (0.1111111111111111 / x)) + -1.0)
function code(x, y) return Float64(Float64(3.0 * sqrt(x)) * Float64(Float64(y + Float64(0.1111111111111111 / x)) + -1.0)) end
function tmp = code(x, y) tmp = (3.0 * sqrt(x)) * ((y + (0.1111111111111111 / x)) + -1.0); end
code[x_, y_] := N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{0.1111111111111111}{x}\right) + -1\right)
\end{array}
Initial program 99.3%
Taylor expanded in x around 0 99.4%
Final simplification99.4%
(FPCore (x y) :precision binary64 (if (<= x 7.8) (* 0.3333333333333333 (sqrt (/ 1.0 x))) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if (x <= 7.8) {
tmp = 0.3333333333333333 * sqrt((1.0 / 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 <= 7.8d0) then
tmp = 0.3333333333333333d0 * sqrt((1.0d0 / 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 <= 7.8) {
tmp = 0.3333333333333333 * Math.sqrt((1.0 / x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 7.8: tmp = 0.3333333333333333 * math.sqrt((1.0 / x)) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 7.8) tmp = Float64(0.3333333333333333 * sqrt(Float64(1.0 / x))); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 7.8) tmp = 0.3333333333333333 * sqrt((1.0 / x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 7.8], N[(0.3333333333333333 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 7.8:\\
\;\;\;\;0.3333333333333333 \cdot \sqrt{\frac{1}{x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 7.79999999999999982Initial program 99.2%
associate-*l*99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 99.2%
associate-*r*99.2%
associate-*r*99.2%
sub-neg99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
distribute-lft-out99.3%
*-commutative99.3%
associate-+r+99.3%
+-commutative99.3%
associate-+r+99.3%
associate-*r*99.2%
distribute-lft-in99.2%
associate-*r/99.3%
metadata-eval99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around inf 97.3%
Taylor expanded in y around 0 69.8%
if 7.79999999999999982 < x Initial program 99.5%
associate-*l*99.4%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 57.4%
sub-neg57.4%
associate-*r/57.4%
metadata-eval57.4%
metadata-eval57.4%
Simplified57.4%
Taylor expanded in x around inf 56.2%
add056.2%
associate-*r*56.2%
fma-define56.2%
/-rgt-identity56.2%
div-inv56.2%
add-sqr-sqrt56.2%
metadata-eval56.2%
metadata-eval56.2%
swap-sqr56.2%
sqrt-unprod0.0%
add-sqr-sqrt1.8%
*-commutative1.8%
add-sqr-sqrt0.0%
sqrt-unprod56.2%
swap-sqr56.2%
add-sqr-sqrt56.2%
metadata-eval56.2%
metadata-eval56.2%
div-inv56.2%
/-rgt-identity56.2%
Applied egg-rr56.2%
fma-undefine56.2%
*-commutative56.2%
add056.2%
mul-1-neg56.2%
distribute-rgt-neg-in56.2%
metadata-eval56.2%
Simplified56.2%
Final simplification63.5%
(FPCore (x y) :precision binary64 (sqrt (* x 9.0)))
double code(double x, double y) {
return sqrt((x * 9.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt((x * 9.0d0))
end function
public static double code(double x, double y) {
return Math.sqrt((x * 9.0));
}
def code(x, y): return math.sqrt((x * 9.0))
function code(x, y) return sqrt(Float64(x * 9.0)) end
function tmp = code(x, y) tmp = sqrt((x * 9.0)); end
code[x_, y_] := N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x \cdot 9}
\end{array}
Initial program 99.3%
associate-*l*99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 65.0%
sub-neg65.0%
associate-*r/65.1%
metadata-eval65.1%
metadata-eval65.1%
Simplified65.1%
Taylor expanded in x around inf 27.1%
add-sqr-sqrt0.0%
sqrt-unprod3.4%
*-commutative3.4%
*-commutative3.4%
swap-sqr3.4%
swap-sqr3.4%
add-sqr-sqrt3.4%
metadata-eval3.4%
metadata-eval3.4%
div-inv3.4%
/-rgt-identity3.4%
metadata-eval3.4%
Applied egg-rr3.4%
Final simplification3.4%
(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.3%
associate-*l*99.3%
sub-neg99.3%
+-commutative99.3%
associate-+l+99.3%
*-commutative99.3%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 65.0%
sub-neg65.0%
associate-*r/65.1%
metadata-eval65.1%
metadata-eval65.1%
Simplified65.1%
Taylor expanded in x around inf 27.1%
add027.1%
associate-*r*27.1%
fma-define27.1%
/-rgt-identity27.1%
div-inv27.1%
add-sqr-sqrt27.1%
metadata-eval27.1%
metadata-eval27.1%
swap-sqr27.1%
sqrt-unprod0.0%
add-sqr-sqrt3.4%
*-commutative3.4%
add-sqr-sqrt0.0%
sqrt-unprod27.1%
swap-sqr27.1%
add-sqr-sqrt27.1%
metadata-eval27.1%
metadata-eval27.1%
div-inv27.1%
/-rgt-identity27.1%
Applied egg-rr27.1%
fma-undefine27.1%
*-commutative27.1%
add027.1%
mul-1-neg27.1%
distribute-rgt-neg-in27.1%
metadata-eval27.1%
Simplified27.1%
Final simplification27.1%
(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 2024034
(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)))