
(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 14 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.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.6%
Applied egg-rr99.6%
Final simplification99.6%
(FPCore (x y)
:precision binary64
(if (<= x 1.45e-61)
(pow (* x 9.0) -0.5)
(if (or (<= x 6.2e+25) (and (not (<= x 1.56e+46)) (<= x 2e+226)))
(* 3.0 (* y (sqrt x)))
(- (sqrt (* x 9.0))))))
double code(double x, double y) {
double tmp;
if (x <= 1.45e-61) {
tmp = pow((x * 9.0), -0.5);
} else if ((x <= 6.2e+25) || (!(x <= 1.56e+46) && (x <= 2e+226))) {
tmp = 3.0 * (y * sqrt(x));
} else {
tmp = -sqrt((x * 9.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.45d-61) then
tmp = (x * 9.0d0) ** (-0.5d0)
else if ((x <= 6.2d+25) .or. (.not. (x <= 1.56d+46)) .and. (x <= 2d+226)) then
tmp = 3.0d0 * (y * sqrt(x))
else
tmp = -sqrt((x * 9.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.45e-61) {
tmp = Math.pow((x * 9.0), -0.5);
} else if ((x <= 6.2e+25) || (!(x <= 1.56e+46) && (x <= 2e+226))) {
tmp = 3.0 * (y * Math.sqrt(x));
} else {
tmp = -Math.sqrt((x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.45e-61: tmp = math.pow((x * 9.0), -0.5) elif (x <= 6.2e+25) or (not (x <= 1.56e+46) and (x <= 2e+226)): tmp = 3.0 * (y * math.sqrt(x)) else: tmp = -math.sqrt((x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 1.45e-61) tmp = Float64(x * 9.0) ^ -0.5; elseif ((x <= 6.2e+25) || (!(x <= 1.56e+46) && (x <= 2e+226))) tmp = Float64(3.0 * Float64(y * sqrt(x))); else tmp = Float64(-sqrt(Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.45e-61) tmp = (x * 9.0) ^ -0.5; elseif ((x <= 6.2e+25) || (~((x <= 1.56e+46)) && (x <= 2e+226))) tmp = 3.0 * (y * sqrt(x)); else tmp = -sqrt((x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.45e-61], N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision], If[Or[LessEqual[x, 6.2e+25], And[N[Not[LessEqual[x, 1.56e+46]], $MachinePrecision], LessEqual[x, 2e+226]]], N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision])]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.45 \cdot 10^{-61}:\\
\;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+25} \lor \neg \left(x \leq 1.56 \cdot 10^{+46}\right) \land x \leq 2 \cdot 10^{+226}:\\
\;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{x \cdot 9}\\
\end{array}
\end{array}
if x < 1.45e-61Initial program 99.1%
*-commutative99.1%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 78.5%
metadata-eval78.5%
sqrt-prod78.7%
metadata-eval78.7%
inv-pow78.7%
unpow-prod-down78.8%
*-commutative78.8%
sqrt-pow178.9%
metadata-eval78.9%
Applied egg-rr78.9%
if 1.45e-61 < x < 6.1999999999999996e25 or 1.56e46 < x < 1.99999999999999992e226Initial program 99.7%
*-commutative99.7%
associate-*l*99.6%
associate--l+99.6%
distribute-lft-in99.6%
fma-define99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
associate-*r/99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 60.2%
if 6.1999999999999996e25 < x < 1.56e46 or 1.99999999999999992e226 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 99.5%
Taylor expanded in y around 0 72.1%
*-commutative72.1%
Simplified72.1%
metadata-eval72.1%
associate-*l*72.1%
*-commutative72.1%
mul-1-neg72.1%
add-sqr-sqrt71.8%
sqrt-unprod72.1%
swap-sqr72.2%
add-sqr-sqrt72.5%
metadata-eval72.5%
Applied egg-rr72.5%
Final simplification69.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (* x 9.0))))
(if (<= x 1.55e-61)
(pow (* x 9.0) -0.5)
(if (or (<= x 1.2e+26) (and (not (<= x 1.4e+49)) (<= x 1.8e+226)))
(* t_0 y)
(- t_0)))))
double code(double x, double y) {
double t_0 = sqrt((x * 9.0));
double tmp;
if (x <= 1.55e-61) {
tmp = pow((x * 9.0), -0.5);
} else if ((x <= 1.2e+26) || (!(x <= 1.4e+49) && (x <= 1.8e+226))) {
tmp = t_0 * y;
} 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) :: tmp
t_0 = sqrt((x * 9.0d0))
if (x <= 1.55d-61) then
tmp = (x * 9.0d0) ** (-0.5d0)
else if ((x <= 1.2d+26) .or. (.not. (x <= 1.4d+49)) .and. (x <= 1.8d+226)) then
tmp = t_0 * y
else
tmp = -t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt((x * 9.0));
double tmp;
if (x <= 1.55e-61) {
tmp = Math.pow((x * 9.0), -0.5);
} else if ((x <= 1.2e+26) || (!(x <= 1.4e+49) && (x <= 1.8e+226))) {
tmp = t_0 * y;
} else {
tmp = -t_0;
}
return tmp;
}
def code(x, y): t_0 = math.sqrt((x * 9.0)) tmp = 0 if x <= 1.55e-61: tmp = math.pow((x * 9.0), -0.5) elif (x <= 1.2e+26) or (not (x <= 1.4e+49) and (x <= 1.8e+226)): tmp = t_0 * y else: tmp = -t_0 return tmp
function code(x, y) t_0 = sqrt(Float64(x * 9.0)) tmp = 0.0 if (x <= 1.55e-61) tmp = Float64(x * 9.0) ^ -0.5; elseif ((x <= 1.2e+26) || (!(x <= 1.4e+49) && (x <= 1.8e+226))) tmp = Float64(t_0 * y); else tmp = Float64(-t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt((x * 9.0)); tmp = 0.0; if (x <= 1.55e-61) tmp = (x * 9.0) ^ -0.5; elseif ((x <= 1.2e+26) || (~((x <= 1.4e+49)) && (x <= 1.8e+226))) tmp = t_0 * y; else tmp = -t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 1.55e-61], N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision], If[Or[LessEqual[x, 1.2e+26], And[N[Not[LessEqual[x, 1.4e+49]], $MachinePrecision], LessEqual[x, 1.8e+226]]], N[(t$95$0 * y), $MachinePrecision], (-t$95$0)]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x \cdot 9}\\
\mathbf{if}\;x \leq 1.55 \cdot 10^{-61}:\\
\;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+26} \lor \neg \left(x \leq 1.4 \cdot 10^{+49}\right) \land x \leq 1.8 \cdot 10^{+226}:\\
\;\;\;\;t\_0 \cdot y\\
\mathbf{else}:\\
\;\;\;\;-t\_0\\
\end{array}
\end{array}
if x < 1.54999999999999997e-61Initial program 99.1%
*-commutative99.1%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 78.5%
metadata-eval78.5%
sqrt-prod78.7%
metadata-eval78.7%
inv-pow78.7%
unpow-prod-down78.8%
*-commutative78.8%
sqrt-pow178.9%
metadata-eval78.9%
Applied egg-rr78.9%
if 1.54999999999999997e-61 < x < 1.20000000000000002e26 or 1.3999999999999999e49 < x < 1.7999999999999999e226Initial program 99.7%
*-commutative99.7%
associate-*l*99.6%
associate--l+99.6%
distribute-lft-in99.6%
fma-define99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
associate-*r/99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 60.4%
*-commutative60.4%
*-commutative60.4%
associate-*r*60.5%
add-exp-log28.2%
add-exp-log28.3%
prod-exp28.0%
add-sqr-sqrt28.0%
sqrt-unprod28.0%
swap-sqr28.0%
add-sqr-sqrt28.0%
metadata-eval28.0%
Applied egg-rr28.0%
exp-sum28.3%
rem-exp-log58.0%
rem-exp-log60.4%
Simplified60.4%
if 1.20000000000000002e26 < x < 1.3999999999999999e49 or 1.7999999999999999e226 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 99.5%
Taylor expanded in y around 0 71.4%
*-commutative71.4%
Simplified71.4%
metadata-eval71.4%
associate-*l*71.4%
*-commutative71.4%
mul-1-neg71.4%
add-sqr-sqrt71.1%
sqrt-unprod71.4%
swap-sqr71.5%
add-sqr-sqrt71.7%
metadata-eval71.7%
Applied egg-rr71.7%
Final simplification69.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (* x 9.0))))
(if (<= x 1.45e-61)
(pow (* x 9.0) -0.5)
(if (<= x 1e+27)
(* (sqrt x) (* y 3.0))
(if (or (<= x 3.3e+47) (not (<= x 3.4e+226))) (- t_0) (* t_0 y))))))
double code(double x, double y) {
double t_0 = sqrt((x * 9.0));
double tmp;
if (x <= 1.45e-61) {
tmp = pow((x * 9.0), -0.5);
} else if (x <= 1e+27) {
tmp = sqrt(x) * (y * 3.0);
} else if ((x <= 3.3e+47) || !(x <= 3.4e+226)) {
tmp = -t_0;
} else {
tmp = t_0 * y;
}
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 * 9.0d0))
if (x <= 1.45d-61) then
tmp = (x * 9.0d0) ** (-0.5d0)
else if (x <= 1d+27) then
tmp = sqrt(x) * (y * 3.0d0)
else if ((x <= 3.3d+47) .or. (.not. (x <= 3.4d+226))) then
tmp = -t_0
else
tmp = t_0 * y
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt((x * 9.0));
double tmp;
if (x <= 1.45e-61) {
tmp = Math.pow((x * 9.0), -0.5);
} else if (x <= 1e+27) {
tmp = Math.sqrt(x) * (y * 3.0);
} else if ((x <= 3.3e+47) || !(x <= 3.4e+226)) {
tmp = -t_0;
} else {
tmp = t_0 * y;
}
return tmp;
}
def code(x, y): t_0 = math.sqrt((x * 9.0)) tmp = 0 if x <= 1.45e-61: tmp = math.pow((x * 9.0), -0.5) elif x <= 1e+27: tmp = math.sqrt(x) * (y * 3.0) elif (x <= 3.3e+47) or not (x <= 3.4e+226): tmp = -t_0 else: tmp = t_0 * y return tmp
function code(x, y) t_0 = sqrt(Float64(x * 9.0)) tmp = 0.0 if (x <= 1.45e-61) tmp = Float64(x * 9.0) ^ -0.5; elseif (x <= 1e+27) tmp = Float64(sqrt(x) * Float64(y * 3.0)); elseif ((x <= 3.3e+47) || !(x <= 3.4e+226)) tmp = Float64(-t_0); else tmp = Float64(t_0 * y); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt((x * 9.0)); tmp = 0.0; if (x <= 1.45e-61) tmp = (x * 9.0) ^ -0.5; elseif (x <= 1e+27) tmp = sqrt(x) * (y * 3.0); elseif ((x <= 3.3e+47) || ~((x <= 3.4e+226))) tmp = -t_0; else tmp = t_0 * y; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 1.45e-61], N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision], If[LessEqual[x, 1e+27], N[(N[Sqrt[x], $MachinePrecision] * N[(y * 3.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 3.3e+47], N[Not[LessEqual[x, 3.4e+226]], $MachinePrecision]], (-t$95$0), N[(t$95$0 * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x \cdot 9}\\
\mathbf{if}\;x \leq 1.45 \cdot 10^{-61}:\\
\;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\
\mathbf{elif}\;x \leq 10^{+27}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+47} \lor \neg \left(x \leq 3.4 \cdot 10^{+226}\right):\\
\;\;\;\;-t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot y\\
\end{array}
\end{array}
if x < 1.45e-61Initial program 99.1%
*-commutative99.1%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 78.5%
metadata-eval78.5%
sqrt-prod78.7%
metadata-eval78.7%
inv-pow78.7%
unpow-prod-down78.8%
*-commutative78.8%
sqrt-pow178.9%
metadata-eval78.9%
Applied egg-rr78.9%
if 1.45e-61 < x < 1e27Initial program 99.4%
*-commutative99.4%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 64.5%
*-commutative64.5%
associate-*l*64.7%
*-commutative64.7%
Simplified64.7%
if 1e27 < x < 3.2999999999999999e47 or 3.39999999999999979e226 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 99.5%
Taylor expanded in y around 0 71.4%
*-commutative71.4%
Simplified71.4%
metadata-eval71.4%
associate-*l*71.4%
*-commutative71.4%
mul-1-neg71.4%
add-sqr-sqrt71.1%
sqrt-unprod71.4%
swap-sqr71.5%
add-sqr-sqrt71.7%
metadata-eval71.7%
Applied egg-rr71.7%
if 3.2999999999999999e47 < x < 3.39999999999999979e226Initial program 99.8%
*-commutative99.8%
associate-*l*99.7%
associate--l+99.7%
distribute-lft-in99.7%
fma-define99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
associate-*r/99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 58.6%
*-commutative58.6%
*-commutative58.6%
associate-*r*58.7%
add-exp-log29.0%
add-exp-log29.0%
prod-exp28.8%
add-sqr-sqrt28.8%
sqrt-unprod28.8%
swap-sqr28.8%
add-sqr-sqrt28.8%
metadata-eval28.8%
Applied egg-rr28.8%
exp-sum29.0%
rem-exp-log56.2%
rem-exp-log58.7%
Simplified58.7%
Final simplification69.9%
(FPCore (x y)
:precision binary64
(if (<= y -4.5e+100)
(* (sqrt x) (* y 3.0))
(if (<= y 62000.0)
(* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))
(* (sqrt (* x 9.0)) y))))
double code(double x, double y) {
double tmp;
if (y <= -4.5e+100) {
tmp = sqrt(x) * (y * 3.0);
} else if (y <= 62000.0) {
tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = sqrt((x * 9.0)) * y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-4.5d+100)) then
tmp = sqrt(x) * (y * 3.0d0)
else if (y <= 62000.0d0) then
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
else
tmp = sqrt((x * 9.0d0)) * y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -4.5e+100) {
tmp = Math.sqrt(x) * (y * 3.0);
} else if (y <= 62000.0) {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = Math.sqrt((x * 9.0)) * y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -4.5e+100: tmp = math.sqrt(x) * (y * 3.0) elif y <= 62000.0: tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0) else: tmp = math.sqrt((x * 9.0)) * y return tmp
function code(x, y) tmp = 0.0 if (y <= -4.5e+100) tmp = Float64(sqrt(x) * Float64(y * 3.0)); elseif (y <= 62000.0) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0)); else tmp = Float64(sqrt(Float64(x * 9.0)) * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -4.5e+100) tmp = sqrt(x) * (y * 3.0); elseif (y <= 62000.0) tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0); else tmp = sqrt((x * 9.0)) * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -4.5e+100], N[(N[Sqrt[x], $MachinePrecision] * N[(y * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 62000.0], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{+100}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\
\mathbf{elif}\;y \leq 62000:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x \cdot 9} \cdot y\\
\end{array}
\end{array}
if y < -4.50000000000000036e100Initial program 99.4%
*-commutative99.4%
associate-*l*99.6%
associate--l+99.6%
distribute-lft-in99.6%
fma-define99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 79.2%
*-commutative79.2%
associate-*l*79.2%
*-commutative79.2%
Simplified79.2%
if -4.50000000000000036e100 < y < 62000Initial program 99.4%
*-commutative99.4%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.4%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 92.1%
sub-neg92.1%
associate-*r/92.1%
metadata-eval92.1%
metadata-eval92.1%
+-commutative92.1%
Simplified92.1%
if 62000 < y Initial program 99.5%
*-commutative99.5%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.5%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 81.4%
*-commutative81.4%
*-commutative81.4%
associate-*r*81.5%
add-exp-log75.8%
add-exp-log75.8%
prod-exp75.4%
add-sqr-sqrt75.4%
sqrt-unprod75.4%
swap-sqr75.4%
add-sqr-sqrt75.4%
metadata-eval75.4%
Applied egg-rr75.4%
exp-sum75.8%
rem-exp-log77.6%
rem-exp-log81.6%
Simplified81.6%
Final simplification87.3%
(FPCore (x y) :precision binary64 (if (<= x 1.4e-61) (pow (* x 9.0) -0.5) (* (sqrt x) (- (* y 3.0) 3.0))))
double code(double x, double y) {
double tmp;
if (x <= 1.4e-61) {
tmp = pow((x * 9.0), -0.5);
} 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 (x <= 1.4d-61) then
tmp = (x * 9.0d0) ** (-0.5d0)
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 (x <= 1.4e-61) {
tmp = Math.pow((x * 9.0), -0.5);
} else {
tmp = Math.sqrt(x) * ((y * 3.0) - 3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.4e-61: tmp = math.pow((x * 9.0), -0.5) else: tmp = math.sqrt(x) * ((y * 3.0) - 3.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 1.4e-61) tmp = Float64(x * 9.0) ^ -0.5; 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 (x <= 1.4e-61) tmp = (x * 9.0) ^ -0.5; else tmp = sqrt(x) * ((y * 3.0) - 3.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.4e-61], N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(y * 3.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.4 \cdot 10^{-61}:\\
\;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3 - 3\right)\\
\end{array}
\end{array}
if x < 1.4000000000000001e-61Initial program 99.1%
*-commutative99.1%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 78.5%
metadata-eval78.5%
sqrt-prod78.7%
metadata-eval78.7%
inv-pow78.7%
unpow-prod-down78.8%
*-commutative78.8%
sqrt-pow178.9%
metadata-eval78.9%
Applied egg-rr78.9%
if 1.4000000000000001e-61 < x Initial program 99.6%
*-commutative99.6%
associate-*l*99.6%
associate--l+99.6%
distribute-lft-in99.6%
fma-define99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
associate-*r/99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 95.2%
Final simplification89.3%
(FPCore (x y) :precision binary64 (* (sqrt x) (* 3.0 (+ (/ 0.1111111111111111 x) (+ y -1.0)))))
double code(double x, double y) {
return sqrt(x) * (3.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) * (3.0d0 * ((0.1111111111111111d0 / x) + (y + (-1.0d0))))
end function
public static double code(double x, double y) {
return Math.sqrt(x) * (3.0 * ((0.1111111111111111 / x) + (y + -1.0)));
}
def code(x, y): return math.sqrt(x) * (3.0 * ((0.1111111111111111 / x) + (y + -1.0)))
function code(x, y) return Float64(sqrt(x) * Float64(3.0 * Float64(Float64(0.1111111111111111 / x) + Float64(y + -1.0)))) end
function tmp = code(x, y) tmp = sqrt(x) * (3.0 * ((0.1111111111111111 / x) + (y + -1.0))); end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x} \cdot \left(3 \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)\right)
\end{array}
Initial program 99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 99.5%
Taylor expanded in y around 0 99.3%
distribute-lft-out99.3%
sub-neg99.3%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
distribute-lft-out99.3%
associate-*l*99.4%
*-commutative99.4%
associate-*l*99.4%
+-commutative99.4%
metadata-eval99.4%
sub-neg99.4%
associate-+l-99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y) :precision binary64 (* (sqrt x) (+ (* y 3.0) (+ (/ 0.3333333333333333 x) -3.0))))
double code(double x, double y) {
return sqrt(x) * ((y * 3.0) + ((0.3333333333333333 / x) + -3.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt(x) * ((y * 3.0d0) + ((0.3333333333333333d0 / x) + (-3.0d0)))
end function
public static double code(double x, double y) {
return Math.sqrt(x) * ((y * 3.0) + ((0.3333333333333333 / x) + -3.0));
}
def code(x, y): return math.sqrt(x) * ((y * 3.0) + ((0.3333333333333333 / x) + -3.0))
function code(x, y) return Float64(sqrt(x) * Float64(Float64(y * 3.0) + Float64(Float64(0.3333333333333333 / x) + -3.0))) end
function tmp = code(x, y) tmp = sqrt(x) * ((y * 3.0) + ((0.3333333333333333 / x) + -3.0)); end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(N[(y * 3.0), $MachinePrecision] + N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x} \cdot \left(y \cdot 3 + \left(\frac{0.3333333333333333}{x} + -3\right)\right)
\end{array}
Initial program 99.4%
*-commutative99.4%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.4%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
fma-undefine99.5%
+-commutative99.5%
+-commutative99.5%
Applied egg-rr99.5%
Final simplification99.5%
(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%
sub-neg99.4%
+-commutative99.4%
associate-+l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.6%
Applied egg-rr99.5%
Final simplification99.5%
(FPCore (x y) :precision binary64 (if (<= x 0.0115) (sqrt (/ 0.1111111111111111 x)) (- (sqrt (* x 9.0)))))
double code(double x, double y) {
double tmp;
if (x <= 0.0115) {
tmp = sqrt((0.1111111111111111 / x));
} else {
tmp = -sqrt((x * 9.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.0115d0) then
tmp = sqrt((0.1111111111111111d0 / x))
else
tmp = -sqrt((x * 9.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.0115) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else {
tmp = -Math.sqrt((x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.0115: tmp = math.sqrt((0.1111111111111111 / x)) else: tmp = -math.sqrt((x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.0115) tmp = sqrt(Float64(0.1111111111111111 / x)); else tmp = Float64(-sqrt(Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.0115) tmp = sqrt((0.1111111111111111 / x)); else tmp = -sqrt((x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.0115], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], (-N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0115:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{x \cdot 9}\\
\end{array}
\end{array}
if x < 0.0115Initial program 99.2%
*-commutative99.2%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 71.9%
metadata-eval71.9%
sqrt-prod72.1%
div-inv72.1%
Applied egg-rr72.1%
if 0.0115 < x Initial program 99.6%
*-commutative99.6%
associate-*l*99.6%
associate--l+99.6%
distribute-lft-in99.6%
fma-define99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
associate-*r/99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 98.7%
Taylor expanded in y around 0 52.2%
*-commutative52.2%
Simplified52.2%
metadata-eval52.2%
associate-*l*52.2%
*-commutative52.2%
mul-1-neg52.2%
add-sqr-sqrt52.0%
sqrt-unprod52.2%
swap-sqr52.3%
add-sqr-sqrt52.4%
metadata-eval52.4%
Applied egg-rr52.4%
Final simplification60.8%
(FPCore (x y) :precision binary64 (if (<= x 0.0115) (pow (* x 9.0) -0.5) (- (sqrt (* x 9.0)))))
double code(double x, double y) {
double tmp;
if (x <= 0.0115) {
tmp = pow((x * 9.0), -0.5);
} else {
tmp = -sqrt((x * 9.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.0115d0) then
tmp = (x * 9.0d0) ** (-0.5d0)
else
tmp = -sqrt((x * 9.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.0115) {
tmp = Math.pow((x * 9.0), -0.5);
} else {
tmp = -Math.sqrt((x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.0115: tmp = math.pow((x * 9.0), -0.5) else: tmp = -math.sqrt((x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.0115) tmp = Float64(x * 9.0) ^ -0.5; else tmp = Float64(-sqrt(Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.0115) tmp = (x * 9.0) ^ -0.5; else tmp = -sqrt((x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.0115], N[Power[N[(x * 9.0), $MachinePrecision], -0.5], $MachinePrecision], (-N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0115:\\
\;\;\;\;{\left(x \cdot 9\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{x \cdot 9}\\
\end{array}
\end{array}
if x < 0.0115Initial program 99.2%
*-commutative99.2%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 71.9%
metadata-eval71.9%
sqrt-prod72.1%
metadata-eval72.1%
inv-pow72.1%
unpow-prod-down72.2%
*-commutative72.2%
sqrt-pow172.3%
metadata-eval72.3%
Applied egg-rr72.3%
if 0.0115 < x Initial program 99.6%
*-commutative99.6%
associate-*l*99.6%
associate--l+99.6%
distribute-lft-in99.6%
fma-define99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
associate-*r/99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 98.7%
Taylor expanded in y around 0 52.2%
*-commutative52.2%
Simplified52.2%
metadata-eval52.2%
associate-*l*52.2%
*-commutative52.2%
mul-1-neg52.2%
add-sqr-sqrt52.0%
sqrt-unprod52.2%
swap-sqr52.3%
add-sqr-sqrt52.4%
metadata-eval52.4%
Applied egg-rr52.4%
Final simplification60.9%
(FPCore (x y) :precision binary64 (if (<= x 0.0115) (sqrt (/ 0.1111111111111111 x)) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if (x <= 0.0115) {
tmp = sqrt((0.1111111111111111 / x));
} else {
tmp = sqrt(x) * -3.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 0.0115d0) then
tmp = sqrt((0.1111111111111111d0 / x))
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.0115) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.0115: tmp = math.sqrt((0.1111111111111111 / x)) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 0.0115) tmp = sqrt(Float64(0.1111111111111111 / x)); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.0115) tmp = sqrt((0.1111111111111111 / x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.0115], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0115:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 0.0115Initial program 99.2%
*-commutative99.2%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 71.9%
metadata-eval71.9%
sqrt-prod72.1%
div-inv72.1%
Applied egg-rr72.1%
if 0.0115 < x Initial program 99.6%
*-commutative99.6%
associate-*l*99.6%
associate--l+99.6%
distribute-lft-in99.6%
fma-define99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in99.6%
metadata-eval99.6%
metadata-eval99.6%
*-commutative99.6%
associate-/r*99.6%
associate-*r/99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 98.7%
Taylor expanded in y around 0 52.2%
*-commutative52.2%
Simplified52.2%
Final simplification60.8%
(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.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.4%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 68.1%
Taylor expanded in y around 0 30.6%
*-commutative30.6%
Simplified30.6%
pow130.6%
add-sqr-sqrt0.0%
sqrt-unprod2.9%
swap-sqr2.9%
add-sqr-sqrt2.9%
metadata-eval2.9%
Applied egg-rr2.9%
unpow12.9%
Simplified2.9%
Final simplification2.9%
(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.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-define99.5%
sub-neg99.5%
+-commutative99.5%
distribute-lft-in99.5%
metadata-eval99.5%
metadata-eval99.5%
*-commutative99.5%
associate-/r*99.4%
associate-*r/99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 32.0%
metadata-eval32.0%
sqrt-prod32.1%
div-inv32.1%
Applied egg-rr32.1%
Final simplification32.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 2024076
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:alt
(* 3.0 (+ (* y (sqrt x)) (* (- (/ 1.0 (* x 9.0)) 1.0) (sqrt x))))
(* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))