
(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 18 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) (+ -3.0 (fma 3.0 y (/ 0.3333333333333333 x)))))
double code(double x, double y) {
return sqrt(x) * (-3.0 + fma(3.0, y, (0.3333333333333333 / x)));
}
function code(x, y) return Float64(sqrt(x) * Float64(-3.0 + fma(3.0, y, Float64(0.3333333333333333 / x)))) end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 + N[(3.0 * y + N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x} \cdot \left(-3 + \mathsf{fma}\left(3, y, \frac{0.3333333333333333}{x}\right)\right)
\end{array}
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%
expm1-log1p-u52.2%
expm1-undefine52.2%
Applied egg-rr52.2%
sub-neg52.2%
metadata-eval52.2%
+-commutative52.2%
log1p-undefine52.2%
rem-exp-log99.5%
fma-define99.5%
+-commutative99.5%
associate-+l+99.5%
associate-+r+99.5%
metadata-eval99.5%
+-commutative99.5%
fma-define99.5%
Simplified99.5%
Taylor expanded in y around 0 99.5%
sub-neg99.5%
associate-*r/99.5%
metadata-eval99.5%
+-commutative99.5%
fma-undefine99.5%
metadata-eval99.5%
+-commutative99.5%
Simplified99.5%
(FPCore (x y)
:precision binary64
(if (<= x 5.6e-19)
(sqrt (/ 0.1111111111111111 x))
(if (or (<= x 2.05e+182) (not (<= x 4e+294)))
(* 3.0 (* (sqrt x) y))
(- (sqrt (* x 9.0))))))
double code(double x, double y) {
double tmp;
if (x <= 5.6e-19) {
tmp = sqrt((0.1111111111111111 / x));
} else if ((x <= 2.05e+182) || !(x <= 4e+294)) {
tmp = 3.0 * (sqrt(x) * y);
} 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 <= 5.6d-19) then
tmp = sqrt((0.1111111111111111d0 / x))
else if ((x <= 2.05d+182) .or. (.not. (x <= 4d+294))) then
tmp = 3.0d0 * (sqrt(x) * y)
else
tmp = -sqrt((x * 9.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 5.6e-19) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else if ((x <= 2.05e+182) || !(x <= 4e+294)) {
tmp = 3.0 * (Math.sqrt(x) * y);
} else {
tmp = -Math.sqrt((x * 9.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 5.6e-19: tmp = math.sqrt((0.1111111111111111 / x)) elif (x <= 2.05e+182) or not (x <= 4e+294): tmp = 3.0 * (math.sqrt(x) * y) else: tmp = -math.sqrt((x * 9.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 5.6e-19) tmp = sqrt(Float64(0.1111111111111111 / x)); elseif ((x <= 2.05e+182) || !(x <= 4e+294)) tmp = Float64(3.0 * Float64(sqrt(x) * y)); else tmp = Float64(-sqrt(Float64(x * 9.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 5.6e-19) tmp = sqrt((0.1111111111111111 / x)); elseif ((x <= 2.05e+182) || ~((x <= 4e+294))) tmp = 3.0 * (sqrt(x) * y); else tmp = -sqrt((x * 9.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 5.6e-19], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 2.05e+182], N[Not[LessEqual[x, 4e+294]], $MachinePrecision]], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision])]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.6 \cdot 10^{-19}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+182} \lor \neg \left(x \leq 4 \cdot 10^{+294}\right):\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{x \cdot 9}\\
\end{array}
\end{array}
if x < 5.60000000000000005e-19Initial program 99.4%
*-commutative99.4%
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.3%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 79.0%
metadata-eval79.0%
sqrt-prod79.2%
div-inv79.1%
pow1/279.1%
Applied egg-rr79.1%
unpow1/279.1%
Simplified79.1%
if 5.60000000000000005e-19 < x < 2.05000000000000001e182 or 4.00000000000000027e294 < x Initial program 99.6%
*-commutative99.6%
associate-*l*99.7%
associate--l+99.7%
distribute-lft-in99.7%
fma-define99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
metadata-eval99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 65.1%
if 2.05000000000000001e182 < x < 4.00000000000000027e294Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.8%
pow1/299.8%
Applied egg-rr99.8%
unpow1/299.8%
Simplified99.8%
Taylor expanded in x around inf 99.8%
Taylor expanded in y around 0 63.9%
Final simplification71.4%
(FPCore (x y)
:precision binary64
(if (<= x 6.2e-21)
(sqrt (/ 0.1111111111111111 x))
(if (or (<= x 5.7e+182) (not (<= x 1.4e+295)))
(* 3.0 (* (sqrt x) y))
(* (sqrt x) -3.0))))
double code(double x, double y) {
double tmp;
if (x <= 6.2e-21) {
tmp = sqrt((0.1111111111111111 / x));
} else if ((x <= 5.7e+182) || !(x <= 1.4e+295)) {
tmp = 3.0 * (sqrt(x) * y);
} else {
tmp = sqrt(x) * -3.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 6.2d-21) then
tmp = sqrt((0.1111111111111111d0 / x))
else if ((x <= 5.7d+182) .or. (.not. (x <= 1.4d+295))) then
tmp = 3.0d0 * (sqrt(x) * y)
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 6.2e-21) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else if ((x <= 5.7e+182) || !(x <= 1.4e+295)) {
tmp = 3.0 * (Math.sqrt(x) * y);
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 6.2e-21: tmp = math.sqrt((0.1111111111111111 / x)) elif (x <= 5.7e+182) or not (x <= 1.4e+295): tmp = 3.0 * (math.sqrt(x) * y) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 6.2e-21) tmp = sqrt(Float64(0.1111111111111111 / x)); elseif ((x <= 5.7e+182) || !(x <= 1.4e+295)) tmp = Float64(3.0 * Float64(sqrt(x) * y)); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 6.2e-21) tmp = sqrt((0.1111111111111111 / x)); elseif ((x <= 5.7e+182) || ~((x <= 1.4e+295))) tmp = 3.0 * (sqrt(x) * y); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 6.2e-21], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[x, 5.7e+182], N[Not[LessEqual[x, 1.4e+295]], $MachinePrecision]], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 6.2 \cdot 10^{-21}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{elif}\;x \leq 5.7 \cdot 10^{+182} \lor \neg \left(x \leq 1.4 \cdot 10^{+295}\right):\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 6.1999999999999997e-21Initial program 99.4%
*-commutative99.4%
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.3%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 79.0%
metadata-eval79.0%
sqrt-prod79.2%
div-inv79.1%
pow1/279.1%
Applied egg-rr79.1%
unpow1/279.1%
Simplified79.1%
if 6.1999999999999997e-21 < x < 5.70000000000000049e182 or 1.4000000000000001e295 < x Initial program 99.6%
*-commutative99.6%
associate-*l*99.7%
associate--l+99.7%
distribute-lft-in99.7%
fma-define99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
metadata-eval99.7%
metadata-eval99.7%
*-commutative99.7%
associate-/r*99.7%
associate-*r/99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 65.1%
if 5.70000000000000049e182 < x < 1.4000000000000001e295Initial program 99.6%
*-commutative99.6%
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 0 63.7%
sub-neg63.7%
metadata-eval63.7%
associate-*r/63.7%
metadata-eval63.7%
+-commutative63.7%
metadata-eval63.7%
distribute-neg-frac63.7%
unsub-neg63.7%
Simplified63.7%
Taylor expanded in x around inf 63.7%
*-commutative63.7%
Simplified63.7%
Final simplification71.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (* x 9.0))))
(if (<= x 2.1e-20)
(sqrt (/ 0.1111111111111111 x))
(if (<= x 9.3e+182)
(* y t_0)
(if (<= x 5.5e+295) (- t_0) (* 3.0 (* (sqrt x) y)))))))
double code(double x, double y) {
double t_0 = sqrt((x * 9.0));
double tmp;
if (x <= 2.1e-20) {
tmp = sqrt((0.1111111111111111 / x));
} else if (x <= 9.3e+182) {
tmp = y * t_0;
} else if (x <= 5.5e+295) {
tmp = -t_0;
} else {
tmp = 3.0 * (sqrt(x) * 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 <= 2.1d-20) then
tmp = sqrt((0.1111111111111111d0 / x))
else if (x <= 9.3d+182) then
tmp = y * t_0
else if (x <= 5.5d+295) then
tmp = -t_0
else
tmp = 3.0d0 * (sqrt(x) * 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 <= 2.1e-20) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else if (x <= 9.3e+182) {
tmp = y * t_0;
} else if (x <= 5.5e+295) {
tmp = -t_0;
} else {
tmp = 3.0 * (Math.sqrt(x) * y);
}
return tmp;
}
def code(x, y): t_0 = math.sqrt((x * 9.0)) tmp = 0 if x <= 2.1e-20: tmp = math.sqrt((0.1111111111111111 / x)) elif x <= 9.3e+182: tmp = y * t_0 elif x <= 5.5e+295: tmp = -t_0 else: tmp = 3.0 * (math.sqrt(x) * y) return tmp
function code(x, y) t_0 = sqrt(Float64(x * 9.0)) tmp = 0.0 if (x <= 2.1e-20) tmp = sqrt(Float64(0.1111111111111111 / x)); elseif (x <= 9.3e+182) tmp = Float64(y * t_0); elseif (x <= 5.5e+295) tmp = Float64(-t_0); else tmp = Float64(3.0 * Float64(sqrt(x) * y)); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt((x * 9.0)); tmp = 0.0; if (x <= 2.1e-20) tmp = sqrt((0.1111111111111111 / x)); elseif (x <= 9.3e+182) tmp = y * t_0; elseif (x <= 5.5e+295) tmp = -t_0; else tmp = 3.0 * (sqrt(x) * y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 2.1e-20], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 9.3e+182], N[(y * t$95$0), $MachinePrecision], If[LessEqual[x, 5.5e+295], (-t$95$0), N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x \cdot 9}\\
\mathbf{if}\;x \leq 2.1 \cdot 10^{-20}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{elif}\;x \leq 9.3 \cdot 10^{+182}:\\
\;\;\;\;y \cdot t\_0\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+295}:\\
\;\;\;\;-t\_0\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\
\end{array}
\end{array}
if x < 2.0999999999999999e-20Initial program 99.4%
*-commutative99.4%
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.3%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 79.0%
metadata-eval79.0%
sqrt-prod79.2%
div-inv79.1%
pow1/279.1%
Applied egg-rr79.1%
unpow1/279.1%
Simplified79.1%
if 2.0999999999999999e-20 < x < 9.3000000000000005e182Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.7%
pow1/299.7%
Applied egg-rr99.7%
unpow1/299.7%
Simplified99.7%
Taylor expanded in y around inf 64.0%
if 9.3000000000000005e182 < x < 5.50000000000000035e295Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.8%
pow1/299.8%
Applied egg-rr99.8%
unpow1/299.8%
Simplified99.8%
Taylor expanded in x around inf 99.8%
Taylor expanded in y around 0 63.9%
if 5.50000000000000035e295 < x Initial program 99.8%
*-commutative99.8%
associate-*l*99.8%
associate--l+99.8%
distribute-lft-in99.8%
fma-define99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
metadata-eval99.8%
metadata-eval99.8%
*-commutative99.8%
associate-/r*99.8%
associate-*r/99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 74.4%
Final simplification71.4%
(FPCore (x y)
:precision binary64
(if (<= y -1.3e+30)
(* y (sqrt (* x 9.0)))
(if (<= y 35000000000000.0)
(* (sqrt x) (- -3.0 (/ -0.3333333333333333 x)))
(* y (sqrt (/ x 0.1111111111111111))))))
double code(double x, double y) {
double tmp;
if (y <= -1.3e+30) {
tmp = y * sqrt((x * 9.0));
} else if (y <= 35000000000000.0) {
tmp = sqrt(x) * (-3.0 - (-0.3333333333333333 / x));
} else {
tmp = y * sqrt((x / 0.1111111111111111));
}
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+30)) then
tmp = y * sqrt((x * 9.0d0))
else if (y <= 35000000000000.0d0) then
tmp = sqrt(x) * ((-3.0d0) - ((-0.3333333333333333d0) / x))
else
tmp = y * sqrt((x / 0.1111111111111111d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.3e+30) {
tmp = y * Math.sqrt((x * 9.0));
} else if (y <= 35000000000000.0) {
tmp = Math.sqrt(x) * (-3.0 - (-0.3333333333333333 / x));
} else {
tmp = y * Math.sqrt((x / 0.1111111111111111));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.3e+30: tmp = y * math.sqrt((x * 9.0)) elif y <= 35000000000000.0: tmp = math.sqrt(x) * (-3.0 - (-0.3333333333333333 / x)) else: tmp = y * math.sqrt((x / 0.1111111111111111)) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.3e+30) tmp = Float64(y * sqrt(Float64(x * 9.0))); elseif (y <= 35000000000000.0) tmp = Float64(sqrt(x) * Float64(-3.0 - Float64(-0.3333333333333333 / x))); else tmp = Float64(y * sqrt(Float64(x / 0.1111111111111111))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.3e+30) tmp = y * sqrt((x * 9.0)); elseif (y <= 35000000000000.0) tmp = sqrt(x) * (-3.0 - (-0.3333333333333333 / x)); else tmp = y * sqrt((x / 0.1111111111111111)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.3e+30], N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 35000000000000.0], N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 - N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[Sqrt[N[(x / 0.1111111111111111), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+30}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\
\mathbf{elif}\;y \leq 35000000000000:\\
\;\;\;\;\sqrt{x} \cdot \left(-3 - \frac{-0.3333333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \sqrt{\frac{x}{0.1111111111111111}}\\
\end{array}
\end{array}
if y < -1.29999999999999994e30Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
Taylor expanded in y around inf 81.3%
if -1.29999999999999994e30 < y < 3.5e13Initial 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 96.3%
sub-neg96.3%
metadata-eval96.3%
associate-*r/96.4%
metadata-eval96.4%
+-commutative96.4%
metadata-eval96.4%
distribute-neg-frac96.4%
unsub-neg96.4%
Simplified96.4%
if 3.5e13 < y Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
metadata-eval99.6%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 76.8%
Final simplification88.1%
(FPCore (x y)
:precision binary64
(if (<= y -3.9e+28)
(* y (sqrt (* x 9.0)))
(if (<= y 7.8e+15)
(* 3.0 (/ (- 0.1111111111111111 x) (sqrt x)))
(* y (sqrt (/ x 0.1111111111111111))))))
double code(double x, double y) {
double tmp;
if (y <= -3.9e+28) {
tmp = y * sqrt((x * 9.0));
} else if (y <= 7.8e+15) {
tmp = 3.0 * ((0.1111111111111111 - x) / sqrt(x));
} else {
tmp = y * sqrt((x / 0.1111111111111111));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-3.9d+28)) then
tmp = y * sqrt((x * 9.0d0))
else if (y <= 7.8d+15) then
tmp = 3.0d0 * ((0.1111111111111111d0 - x) / sqrt(x))
else
tmp = y * sqrt((x / 0.1111111111111111d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.9e+28) {
tmp = y * Math.sqrt((x * 9.0));
} else if (y <= 7.8e+15) {
tmp = 3.0 * ((0.1111111111111111 - x) / Math.sqrt(x));
} else {
tmp = y * Math.sqrt((x / 0.1111111111111111));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.9e+28: tmp = y * math.sqrt((x * 9.0)) elif y <= 7.8e+15: tmp = 3.0 * ((0.1111111111111111 - x) / math.sqrt(x)) else: tmp = y * math.sqrt((x / 0.1111111111111111)) return tmp
function code(x, y) tmp = 0.0 if (y <= -3.9e+28) tmp = Float64(y * sqrt(Float64(x * 9.0))); elseif (y <= 7.8e+15) tmp = Float64(3.0 * Float64(Float64(0.1111111111111111 - x) / sqrt(x))); else tmp = Float64(y * sqrt(Float64(x / 0.1111111111111111))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.9e+28) tmp = y * sqrt((x * 9.0)); elseif (y <= 7.8e+15) tmp = 3.0 * ((0.1111111111111111 - x) / sqrt(x)); else tmp = y * sqrt((x / 0.1111111111111111)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.9e+28], N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e+15], N[(3.0 * N[(N[(0.1111111111111111 - x), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[Sqrt[N[(x / 0.1111111111111111), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{+28}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+15}:\\
\;\;\;\;3 \cdot \frac{0.1111111111111111 - x}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \sqrt{\frac{x}{0.1111111111111111}}\\
\end{array}
\end{array}
if y < -3.8999999999999999e28Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
Taylor expanded in y around inf 81.3%
if -3.8999999999999999e28 < y < 7.8e15Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod98.8%
pow1/298.8%
Applied egg-rr98.8%
unpow1/298.8%
Simplified98.8%
Taylor expanded in x around 0 98.0%
Taylor expanded in y around 0 96.2%
*-commutative96.2%
associate-*l*95.6%
neg-mul-195.6%
unsub-neg95.6%
Simplified95.6%
*-commutative95.6%
sqrt-div95.6%
metadata-eval95.6%
un-div-inv95.6%
*-commutative95.6%
Applied egg-rr95.6%
associate-*r/96.2%
Simplified96.2%
if 7.8e15 < y Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
*-commutative99.5%
associate-/r*99.5%
metadata-eval99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
*-commutative99.5%
metadata-eval99.5%
sqrt-prod99.6%
pow1/299.6%
Applied egg-rr99.6%
unpow1/299.6%
Simplified99.6%
metadata-eval99.6%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 76.8%
Final simplification88.0%
(FPCore (x y) :precision binary64 (if (<= x 0.0035) (* (sqrt (/ 1.0 x)) (* 3.0 (- 0.1111111111111111 x))) (* (* (sqrt x) 3.0) (+ y -1.0))))
double code(double x, double y) {
double tmp;
if (x <= 0.0035) {
tmp = sqrt((1.0 / x)) * (3.0 * (0.1111111111111111 - x));
} else {
tmp = (sqrt(x) * 3.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.0035d0) then
tmp = sqrt((1.0d0 / x)) * (3.0d0 * (0.1111111111111111d0 - x))
else
tmp = (sqrt(x) * 3.0d0) * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.0035) {
tmp = Math.sqrt((1.0 / x)) * (3.0 * (0.1111111111111111 - x));
} else {
tmp = (Math.sqrt(x) * 3.0) * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.0035: tmp = math.sqrt((1.0 / x)) * (3.0 * (0.1111111111111111 - x)) else: tmp = (math.sqrt(x) * 3.0) * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.0035) tmp = Float64(sqrt(Float64(1.0 / x)) * Float64(3.0 * Float64(0.1111111111111111 - x))); else tmp = Float64(Float64(sqrt(x) * 3.0) * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.0035) tmp = sqrt((1.0 / x)) * (3.0 * (0.1111111111111111 - x)); else tmp = (sqrt(x) * 3.0) * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.0035], N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] * N[(3.0 * N[(0.1111111111111111 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[x], $MachinePrecision] * 3.0), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0035:\\
\;\;\;\;\sqrt{\frac{1}{x}} \cdot \left(3 \cdot \left(0.1111111111111111 - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x} \cdot 3\right) \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < 0.00350000000000000007Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
*-commutative99.3%
associate-/r*99.2%
metadata-eval99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
*-commutative99.2%
metadata-eval99.2%
sqrt-prod99.3%
pow1/299.3%
Applied egg-rr99.3%
unpow1/299.3%
Simplified99.3%
Taylor expanded in x around 0 99.2%
Taylor expanded in y around 0 78.5%
*-commutative78.5%
associate-*l*78.7%
neg-mul-178.7%
unsub-neg78.7%
Simplified78.7%
if 0.00350000000000000007 < x Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 98.6%
Final simplification89.1%
(FPCore (x y) :precision binary64 (* (* (sqrt x) 3.0) (+ (+ y (/ 1.0 (* x 9.0))) -1.0)))
double code(double x, double y) {
return (sqrt(x) * 3.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) * 3.0d0) * ((y + (1.0d0 / (x * 9.0d0))) + (-1.0d0))
end function
public static double code(double x, double y) {
return (Math.sqrt(x) * 3.0) * ((y + (1.0 / (x * 9.0))) + -1.0);
}
def code(x, y): return (math.sqrt(x) * 3.0) * ((y + (1.0 / (x * 9.0))) + -1.0)
function code(x, y) return Float64(Float64(sqrt(x) * 3.0) * Float64(Float64(y + Float64(1.0 / Float64(x * 9.0))) + -1.0)) end
function tmp = code(x, y) tmp = (sqrt(x) * 3.0) * ((y + (1.0 / (x * 9.0))) + -1.0); end
code[x_, y_] := N[(N[(N[Sqrt[x], $MachinePrecision] * 3.0), $MachinePrecision] * N[(N[(y + N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\sqrt{x} \cdot 3\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) + -1\right)
\end{array}
Initial program 99.5%
Final simplification99.5%
(FPCore (x y) :precision binary64 (if (<= x 0.057) (/ (* 3.0 (- 0.1111111111111111 x)) (sqrt x)) (* (* (sqrt x) 3.0) (+ y -1.0))))
double code(double x, double y) {
double tmp;
if (x <= 0.057) {
tmp = (3.0 * (0.1111111111111111 - x)) / sqrt(x);
} else {
tmp = (sqrt(x) * 3.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.057d0) then
tmp = (3.0d0 * (0.1111111111111111d0 - x)) / sqrt(x)
else
tmp = (sqrt(x) * 3.0d0) * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.057) {
tmp = (3.0 * (0.1111111111111111 - x)) / Math.sqrt(x);
} else {
tmp = (Math.sqrt(x) * 3.0) * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.057: tmp = (3.0 * (0.1111111111111111 - x)) / math.sqrt(x) else: tmp = (math.sqrt(x) * 3.0) * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.057) tmp = Float64(Float64(3.0 * Float64(0.1111111111111111 - x)) / sqrt(x)); else tmp = Float64(Float64(sqrt(x) * 3.0) * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.057) tmp = (3.0 * (0.1111111111111111 - x)) / sqrt(x); else tmp = (sqrt(x) * 3.0) * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.057], N[(N[(3.0 * N[(0.1111111111111111 - x), $MachinePrecision]), $MachinePrecision] / N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[x], $MachinePrecision] * 3.0), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.057:\\
\;\;\;\;\frac{3 \cdot \left(0.1111111111111111 - x\right)}{\sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x} \cdot 3\right) \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < 0.0570000000000000021Initial program 99.3%
+-commutative99.3%
associate--l+99.3%
*-commutative99.3%
associate-/r*99.2%
metadata-eval99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
*-commutative99.2%
metadata-eval99.2%
sqrt-prod99.3%
pow1/299.3%
Applied egg-rr99.3%
unpow1/299.3%
Simplified99.3%
Taylor expanded in x around 0 99.2%
Taylor expanded in y around 0 78.5%
*-commutative78.5%
associate-*l*78.7%
neg-mul-178.7%
unsub-neg78.7%
Simplified78.7%
*-commutative78.7%
sqrt-div78.6%
metadata-eval78.6%
un-div-inv78.6%
*-commutative78.6%
Applied egg-rr78.6%
if 0.0570000000000000021 < x Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 98.6%
Final simplification89.1%
(FPCore (x y) :precision binary64 (if (<= x 0.0165) (* (sqrt x) (- -3.0 (/ -0.3333333333333333 x))) (* (* (sqrt x) 3.0) (+ y -1.0))))
double code(double x, double y) {
double tmp;
if (x <= 0.0165) {
tmp = sqrt(x) * (-3.0 - (-0.3333333333333333 / x));
} else {
tmp = (sqrt(x) * 3.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.0165d0) then
tmp = sqrt(x) * ((-3.0d0) - ((-0.3333333333333333d0) / x))
else
tmp = (sqrt(x) * 3.0d0) * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.0165) {
tmp = Math.sqrt(x) * (-3.0 - (-0.3333333333333333 / x));
} else {
tmp = (Math.sqrt(x) * 3.0) * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.0165: tmp = math.sqrt(x) * (-3.0 - (-0.3333333333333333 / x)) else: tmp = (math.sqrt(x) * 3.0) * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.0165) tmp = Float64(sqrt(x) * Float64(-3.0 - Float64(-0.3333333333333333 / x))); else tmp = Float64(Float64(sqrt(x) * 3.0) * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.0165) tmp = sqrt(x) * (-3.0 - (-0.3333333333333333 / x)); else tmp = (sqrt(x) * 3.0) * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.0165], N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 - N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[x], $MachinePrecision] * 3.0), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0165:\\
\;\;\;\;\sqrt{x} \cdot \left(-3 - \frac{-0.3333333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x} \cdot 3\right) \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < 0.016500000000000001Initial program 99.3%
*-commutative99.3%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.3%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 78.5%
sub-neg78.5%
metadata-eval78.5%
associate-*r/78.5%
metadata-eval78.5%
+-commutative78.5%
metadata-eval78.5%
distribute-neg-frac78.5%
unsub-neg78.5%
Simplified78.5%
if 0.016500000000000001 < x Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 98.6%
Final simplification89.1%
(FPCore (x y) :precision binary64 (if (<= x 0.00033) (* (sqrt x) (- -3.0 (/ -0.3333333333333333 x))) (* (sqrt (* x 9.0)) (+ y -1.0))))
double code(double x, double y) {
double tmp;
if (x <= 0.00033) {
tmp = sqrt(x) * (-3.0 - (-0.3333333333333333 / x));
} 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.00033d0) then
tmp = sqrt(x) * ((-3.0d0) - ((-0.3333333333333333d0) / x))
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.00033) {
tmp = Math.sqrt(x) * (-3.0 - (-0.3333333333333333 / x));
} else {
tmp = Math.sqrt((x * 9.0)) * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.00033: tmp = math.sqrt(x) * (-3.0 - (-0.3333333333333333 / x)) else: tmp = math.sqrt((x * 9.0)) * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.00033) tmp = Float64(sqrt(x) * Float64(-3.0 - Float64(-0.3333333333333333 / x))); 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.00033) tmp = sqrt(x) * (-3.0 - (-0.3333333333333333 / x)); else tmp = sqrt((x * 9.0)) * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.00033], N[(N[Sqrt[x], $MachinePrecision] * N[(-3.0 - N[(-0.3333333333333333 / x), $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.00033:\\
\;\;\;\;\sqrt{x} \cdot \left(-3 - \frac{-0.3333333333333333}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x \cdot 9} \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < 3.3e-4Initial program 99.3%
*-commutative99.3%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.3%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 78.5%
sub-neg78.5%
metadata-eval78.5%
associate-*r/78.5%
metadata-eval78.5%
+-commutative78.5%
metadata-eval78.5%
distribute-neg-frac78.5%
unsub-neg78.5%
Simplified78.5%
if 3.3e-4 < x Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
*-commutative99.6%
associate-/r*99.6%
metadata-eval99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
*-commutative99.6%
metadata-eval99.6%
sqrt-prod99.1%
pow1/299.1%
Applied egg-rr99.1%
unpow1/299.1%
Simplified99.1%
Taylor expanded in x around inf 98.0%
Final simplification88.7%
(FPCore (x y) :precision binary64 (/ (* (sqrt x) (+ (/ 0.1111111111111111 x) (+ y -1.0))) 0.3333333333333333))
double code(double x, double y) {
return (sqrt(x) * ((0.1111111111111111 / x) + (y + -1.0))) / 0.3333333333333333;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sqrt(x) * ((0.1111111111111111d0 / x) + (y + (-1.0d0)))) / 0.3333333333333333d0
end function
public static double code(double x, double y) {
return (Math.sqrt(x) * ((0.1111111111111111 / x) + (y + -1.0))) / 0.3333333333333333;
}
def code(x, y): return (math.sqrt(x) * ((0.1111111111111111 / x) + (y + -1.0))) / 0.3333333333333333
function code(x, y) return Float64(Float64(sqrt(x) * Float64(Float64(0.1111111111111111 / x) + Float64(y + -1.0))) / 0.3333333333333333) end
function tmp = code(x, y) tmp = (sqrt(x) * ((0.1111111111111111 / x) + (y + -1.0))) / 0.3333333333333333; end
code[x_, y_] := N[(N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)}{0.3333333333333333}
\end{array}
Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
*-commutative99.5%
associate-/r*99.4%
metadata-eval99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.2%
pow1/299.2%
Applied egg-rr99.2%
unpow1/299.2%
Simplified99.2%
metadata-eval99.2%
div-inv99.2%
Applied egg-rr99.2%
*-commutative99.2%
sqrt-div99.4%
metadata-eval99.4%
associate-*r/99.5%
Applied egg-rr99.5%
Final simplification99.5%
(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(Float64(sqrt(x) * 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[(N[Sqrt[x], $MachinePrecision] * 3.0), $MachinePrecision] * N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\sqrt{x} \cdot 3\right) \cdot \left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
*-commutative99.5%
associate-/r*99.4%
metadata-eval99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y) :precision binary64 (* (+ (/ 0.1111111111111111 x) (+ y -1.0)) (sqrt (/ x 0.1111111111111111))))
double code(double x, double y) {
return ((0.1111111111111111 / x) + (y + -1.0)) * sqrt((x / 0.1111111111111111));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((0.1111111111111111d0 / x) + (y + (-1.0d0))) * sqrt((x / 0.1111111111111111d0))
end function
public static double code(double x, double y) {
return ((0.1111111111111111 / x) + (y + -1.0)) * Math.sqrt((x / 0.1111111111111111));
}
def code(x, y): return ((0.1111111111111111 / x) + (y + -1.0)) * math.sqrt((x / 0.1111111111111111))
function code(x, y) return Float64(Float64(Float64(0.1111111111111111 / x) + Float64(y + -1.0)) * sqrt(Float64(x / 0.1111111111111111))) end
function tmp = code(x, y) tmp = ((0.1111111111111111 / x) + (y + -1.0)) * sqrt((x / 0.1111111111111111)); end
code[x_, y_] := N[(N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(x / 0.1111111111111111), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right) \cdot \sqrt{\frac{x}{0.1111111111111111}}
\end{array}
Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
*-commutative99.5%
associate-/r*99.4%
metadata-eval99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.2%
pow1/299.2%
Applied egg-rr99.2%
unpow1/299.2%
Simplified99.2%
metadata-eval99.2%
div-inv99.2%
Applied egg-rr99.2%
Final simplification99.2%
(FPCore (x y) :precision binary64 (* (+ (/ 0.1111111111111111 x) (+ y -1.0)) (sqrt (* x 9.0))))
double code(double x, double y) {
return ((0.1111111111111111 / x) + (y + -1.0)) * sqrt((x * 9.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((0.1111111111111111d0 / x) + (y + (-1.0d0))) * sqrt((x * 9.0d0))
end function
public static double code(double x, double y) {
return ((0.1111111111111111 / x) + (y + -1.0)) * Math.sqrt((x * 9.0));
}
def code(x, y): return ((0.1111111111111111 / x) + (y + -1.0)) * math.sqrt((x * 9.0))
function code(x, y) return Float64(Float64(Float64(0.1111111111111111 / x) + Float64(y + -1.0)) * sqrt(Float64(x * 9.0))) end
function tmp = code(x, y) tmp = ((0.1111111111111111 / x) + (y + -1.0)) * sqrt((x * 9.0)); end
code[x_, y_] := N[(N[(N[(0.1111111111111111 / x), $MachinePrecision] + N[(y + -1.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{0.1111111111111111}{x} + \left(y + -1\right)\right) \cdot \sqrt{x \cdot 9}
\end{array}
Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
*-commutative99.5%
associate-/r*99.4%
metadata-eval99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
metadata-eval99.4%
sqrt-prod99.2%
pow1/299.2%
Applied egg-rr99.2%
unpow1/299.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y) :precision binary64 (if (<= x 0.096) (sqrt (/ 0.1111111111111111 x)) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if (x <= 0.096) {
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.096d0) 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.096) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.096: 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.096) 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.096) tmp = sqrt((0.1111111111111111 / x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.096], 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.096:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if x < 0.096000000000000002Initial program 99.3%
*-commutative99.3%
associate-*l*99.3%
associate--l+99.3%
distribute-lft-in99.3%
fma-define99.3%
sub-neg99.3%
+-commutative99.3%
distribute-lft-in99.3%
metadata-eval99.3%
metadata-eval99.3%
*-commutative99.3%
associate-/r*99.3%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 77.8%
metadata-eval77.8%
sqrt-prod78.0%
div-inv77.9%
pow1/277.9%
Applied egg-rr77.9%
unpow1/277.9%
Simplified77.9%
if 0.096000000000000002 < 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 y around 0 45.4%
sub-neg45.4%
metadata-eval45.4%
associate-*r/45.4%
metadata-eval45.4%
+-commutative45.4%
metadata-eval45.4%
distribute-neg-frac45.4%
unsub-neg45.4%
Simplified45.4%
Taylor expanded in x around inf 44.4%
*-commutative44.4%
Simplified44.4%
(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.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 0 38.1%
metadata-eval38.1%
sqrt-prod38.2%
div-inv38.1%
pow1/238.1%
Applied egg-rr38.1%
unpow1/238.1%
Simplified38.1%
(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.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 0 61.1%
sub-neg61.1%
metadata-eval61.1%
associate-*r/61.2%
metadata-eval61.2%
+-commutative61.2%
metadata-eval61.2%
distribute-neg-frac61.2%
unsub-neg61.2%
Simplified61.2%
Taylor expanded in x around inf 24.0%
*-commutative24.0%
Simplified24.0%
add-sqr-sqrt0.0%
sqrt-unprod3.2%
swap-sqr3.2%
add-sqr-sqrt3.2%
metadata-eval3.2%
Applied egg-rr3.2%
(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 2024186
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:alt
(! :herbie-platform default (* 3 (+ (* y (sqrt x)) (* (- (/ 1 (* x 9)) 1) (sqrt x)))))
(* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))