
(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 (* (* 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}
Initial program 99.4%
Final simplification99.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (sqrt x) -3.0)) (t_1 (* 3.0 (* (sqrt x) y))))
(if (<= x 0.00015)
(* (sqrt x) (/ 0.3333333333333333 x))
(if (<= x 1.22e+54)
(* (sqrt x) (* 3.0 y))
(if (<= x 2.1e+86)
t_0
(if (<= x 9e+106)
t_1
(if (<= x 2.05e+138)
t_0
(if (<= x 7.6e+167)
(* y (sqrt (* x 9.0)))
(if (or (<= x 2.1e+243) (not (<= x 9.6e+291))) t_0 t_1)))))))))
double code(double x, double y) {
double t_0 = sqrt(x) * -3.0;
double t_1 = 3.0 * (sqrt(x) * y);
double tmp;
if (x <= 0.00015) {
tmp = sqrt(x) * (0.3333333333333333 / x);
} else if (x <= 1.22e+54) {
tmp = sqrt(x) * (3.0 * y);
} else if (x <= 2.1e+86) {
tmp = t_0;
} else if (x <= 9e+106) {
tmp = t_1;
} else if (x <= 2.05e+138) {
tmp = t_0;
} else if (x <= 7.6e+167) {
tmp = y * sqrt((x * 9.0));
} else if ((x <= 2.1e+243) || !(x <= 9.6e+291)) {
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 * (sqrt(x) * y)
if (x <= 0.00015d0) then
tmp = sqrt(x) * (0.3333333333333333d0 / x)
else if (x <= 1.22d+54) then
tmp = sqrt(x) * (3.0d0 * y)
else if (x <= 2.1d+86) then
tmp = t_0
else if (x <= 9d+106) then
tmp = t_1
else if (x <= 2.05d+138) then
tmp = t_0
else if (x <= 7.6d+167) then
tmp = y * sqrt((x * 9.0d0))
else if ((x <= 2.1d+243) .or. (.not. (x <= 9.6d+291))) 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 * (Math.sqrt(x) * y);
double tmp;
if (x <= 0.00015) {
tmp = Math.sqrt(x) * (0.3333333333333333 / x);
} else if (x <= 1.22e+54) {
tmp = Math.sqrt(x) * (3.0 * y);
} else if (x <= 2.1e+86) {
tmp = t_0;
} else if (x <= 9e+106) {
tmp = t_1;
} else if (x <= 2.05e+138) {
tmp = t_0;
} else if (x <= 7.6e+167) {
tmp = y * Math.sqrt((x * 9.0));
} else if ((x <= 2.1e+243) || !(x <= 9.6e+291)) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y): t_0 = math.sqrt(x) * -3.0 t_1 = 3.0 * (math.sqrt(x) * y) tmp = 0 if x <= 0.00015: tmp = math.sqrt(x) * (0.3333333333333333 / x) elif x <= 1.22e+54: tmp = math.sqrt(x) * (3.0 * y) elif x <= 2.1e+86: tmp = t_0 elif x <= 9e+106: tmp = t_1 elif x <= 2.05e+138: tmp = t_0 elif x <= 7.6e+167: tmp = y * math.sqrt((x * 9.0)) elif (x <= 2.1e+243) or not (x <= 9.6e+291): 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(sqrt(x) * y)) tmp = 0.0 if (x <= 0.00015) tmp = Float64(sqrt(x) * Float64(0.3333333333333333 / x)); elseif (x <= 1.22e+54) tmp = Float64(sqrt(x) * Float64(3.0 * y)); elseif (x <= 2.1e+86) tmp = t_0; elseif (x <= 9e+106) tmp = t_1; elseif (x <= 2.05e+138) tmp = t_0; elseif (x <= 7.6e+167) tmp = Float64(y * sqrt(Float64(x * 9.0))); elseif ((x <= 2.1e+243) || !(x <= 9.6e+291)) 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 * (sqrt(x) * y); tmp = 0.0; if (x <= 0.00015) tmp = sqrt(x) * (0.3333333333333333 / x); elseif (x <= 1.22e+54) tmp = sqrt(x) * (3.0 * y); elseif (x <= 2.1e+86) tmp = t_0; elseif (x <= 9e+106) tmp = t_1; elseif (x <= 2.05e+138) tmp = t_0; elseif (x <= 7.6e+167) tmp = y * sqrt((x * 9.0)); elseif ((x <= 2.1e+243) || ~((x <= 9.6e+291))) 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[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.00015], N[(N[Sqrt[x], $MachinePrecision] * N[(0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.22e+54], N[(N[Sqrt[x], $MachinePrecision] * N[(3.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.1e+86], t$95$0, If[LessEqual[x, 9e+106], t$95$1, If[LessEqual[x, 2.05e+138], t$95$0, If[LessEqual[x, 7.6e+167], N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 2.1e+243], N[Not[LessEqual[x, 9.6e+291]], $MachinePrecision]], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x} \cdot -3\\
t_1 := 3 \cdot \left(\sqrt{x} \cdot y\right)\\
\mathbf{if}\;x \leq 0.00015:\\
\;\;\;\;\sqrt{x} \cdot \frac{0.3333333333333333}{x}\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{+54}:\\
\;\;\;\;\sqrt{x} \cdot \left(3 \cdot y\right)\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+86}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+106}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+138}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{+167}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{+243} \lor \neg \left(x \leq 9.6 \cdot 10^{+291}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < 1.49999999999999987e-4Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-def99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 78.7%
if 1.49999999999999987e-4 < x < 1.22e54Initial program 99.7%
*-commutative99.7%
associate-*l*99.9%
associate--l+99.9%
distribute-lft-in99.9%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
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 58.5%
if 1.22e54 < x < 2.0999999999999999e86 or 8.9999999999999994e106 < x < 2.0499999999999999e138 or 7.59999999999999987e167 < x < 2.0999999999999999e243 or 9.6e291 < x Initial program 99.5%
*-commutative99.5%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-def99.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 x around inf 99.4%
Taylor expanded in y around 0 70.0%
*-commutative70.0%
Simplified70.0%
if 2.0999999999999999e86 < x < 8.9999999999999994e106 or 2.0999999999999999e243 < x < 9.6e291Initial program 99.6%
Taylor expanded in y around inf 80.1%
*-commutative80.1%
Simplified80.1%
if 2.0499999999999999e138 < x < 7.59999999999999987e167Initial program 99.6%
Taylor expanded in y around inf 71.3%
*-commutative71.3%
Simplified71.3%
expm1-log1p-u37.5%
expm1-udef37.3%
*-commutative37.3%
*-commutative37.3%
associate-*r*37.3%
*-commutative37.3%
*-commutative37.3%
metadata-eval37.3%
sqrt-prod37.3%
Applied egg-rr37.3%
expm1-def37.5%
expm1-log1p71.4%
Simplified71.4%
Final simplification74.3%
(FPCore (x y)
:precision binary64
(if (<= y -3.1e+56)
(* y (sqrt (* x 9.0)))
(if (<= y 1.1e+18)
(* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))
(* (* 3.0 (sqrt x)) y))))
double code(double x, double y) {
double tmp;
if (y <= -3.1e+56) {
tmp = y * sqrt((x * 9.0));
} else if (y <= 1.1e+18) {
tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.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) :: tmp
if (y <= (-3.1d+56)) then
tmp = y * sqrt((x * 9.0d0))
else if (y <= 1.1d+18) then
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
else
tmp = (3.0d0 * sqrt(x)) * y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.1e+56) {
tmp = y * Math.sqrt((x * 9.0));
} else if (y <= 1.1e+18) {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = (3.0 * Math.sqrt(x)) * y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.1e+56: tmp = y * math.sqrt((x * 9.0)) elif y <= 1.1e+18: tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0) else: tmp = (3.0 * math.sqrt(x)) * y return tmp
function code(x, y) tmp = 0.0 if (y <= -3.1e+56) tmp = Float64(y * sqrt(Float64(x * 9.0))); elseif (y <= 1.1e+18) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0)); else tmp = Float64(Float64(3.0 * sqrt(x)) * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.1e+56) tmp = y * sqrt((x * 9.0)); elseif (y <= 1.1e+18) tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0); else tmp = (3.0 * sqrt(x)) * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.1e+56], N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e+18], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+56}:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+18}:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(3 \cdot \sqrt{x}\right) \cdot y\\
\end{array}
\end{array}
if y < -3.10000000000000005e56Initial program 99.5%
Taylor expanded in y around inf 76.1%
*-commutative76.1%
Simplified76.1%
expm1-log1p-u0.1%
expm1-udef0.1%
*-commutative0.1%
*-commutative0.1%
associate-*r*0.1%
*-commutative0.1%
*-commutative0.1%
metadata-eval0.1%
sqrt-prod0.1%
Applied egg-rr0.1%
expm1-def0.1%
expm1-log1p76.2%
Simplified76.2%
if -3.10000000000000005e56 < y < 1.1e18Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-def99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.3%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 93.4%
*-commutative93.4%
sub-neg93.4%
associate-*r/93.4%
metadata-eval93.4%
metadata-eval93.4%
Simplified93.4%
if 1.1e18 < y Initial program 99.5%
Taylor expanded in y around inf 76.2%
*-commutative76.2%
associate-*l*76.4%
*-commutative76.4%
Simplified76.4%
Final simplification86.0%
(FPCore (x y) :precision binary64 (if (<= x 0.0032) (* (sqrt x) (- (* 0.3333333333333333 (/ 1.0 x)) 3.0)) (* (* 3.0 (sqrt x)) (+ y -1.0))))
double code(double x, double y) {
double tmp;
if (x <= 0.0032) {
tmp = sqrt(x) * ((0.3333333333333333 * (1.0 / x)) - 3.0);
} else {
tmp = (3.0 * sqrt(x)) * (y + -1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 0.0032d0) then
tmp = sqrt(x) * ((0.3333333333333333d0 * (1.0d0 / x)) - 3.0d0)
else
tmp = (3.0d0 * sqrt(x)) * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.0032) {
tmp = Math.sqrt(x) * ((0.3333333333333333 * (1.0 / x)) - 3.0);
} else {
tmp = (3.0 * Math.sqrt(x)) * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.0032: tmp = math.sqrt(x) * ((0.3333333333333333 * (1.0 / x)) - 3.0) else: tmp = (3.0 * math.sqrt(x)) * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.0032) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 * Float64(1.0 / x)) - 3.0)); else tmp = Float64(Float64(3.0 * sqrt(x)) * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.0032) tmp = sqrt(x) * ((0.3333333333333333 * (1.0 / x)) - 3.0); else tmp = (3.0 * sqrt(x)) * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.0032], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0032:\\
\;\;\;\;\sqrt{x} \cdot \left(0.3333333333333333 \cdot \frac{1}{x} - 3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(3 \cdot \sqrt{x}\right) \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < 0.00320000000000000015Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-def99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 79.5%
if 0.00320000000000000015 < x Initial program 99.6%
Taylor expanded in y around inf 98.8%
Final simplification89.6%
(FPCore (x y) :precision binary64 (if (<= x 0.0145) (* (sqrt x) (- (/ 1.0 (/ x 0.3333333333333333)) 3.0)) (* (* 3.0 (sqrt x)) (+ y -1.0))))
double code(double x, double y) {
double tmp;
if (x <= 0.0145) {
tmp = sqrt(x) * ((1.0 / (x / 0.3333333333333333)) - 3.0);
} else {
tmp = (3.0 * sqrt(x)) * (y + -1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 0.0145d0) then
tmp = sqrt(x) * ((1.0d0 / (x / 0.3333333333333333d0)) - 3.0d0)
else
tmp = (3.0d0 * sqrt(x)) * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.0145) {
tmp = Math.sqrt(x) * ((1.0 / (x / 0.3333333333333333)) - 3.0);
} else {
tmp = (3.0 * Math.sqrt(x)) * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.0145: tmp = math.sqrt(x) * ((1.0 / (x / 0.3333333333333333)) - 3.0) else: tmp = (3.0 * math.sqrt(x)) * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.0145) tmp = Float64(sqrt(x) * Float64(Float64(1.0 / Float64(x / 0.3333333333333333)) - 3.0)); else tmp = Float64(Float64(3.0 * sqrt(x)) * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.0145) tmp = sqrt(x) * ((1.0 / (x / 0.3333333333333333)) - 3.0); else tmp = (3.0 * sqrt(x)) * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.0145], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(1.0 / N[(x / 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0145:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{1}{\frac{x}{0.3333333333333333}} - 3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(3 \cdot \sqrt{x}\right) \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < 0.0145000000000000007Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-def99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 79.5%
un-div-inv79.5%
clear-num79.5%
Applied egg-rr79.5%
if 0.0145000000000000007 < x Initial program 99.6%
Taylor expanded in y around inf 98.8%
Final simplification89.6%
(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(3.0 * Float64(sqrt(x) * Float64(y + Float64(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[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(y + N[(N[(0.1111111111111111 / x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
3 \cdot \left(\sqrt{x} \cdot \left(y + \left(\frac{0.1111111111111111}{x} + -1\right)\right)\right)
\end{array}
Initial program 99.4%
associate-*l*99.4%
associate--l+99.4%
sub-neg99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.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(y + Float64(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[(y + N[(N[(0.1111111111111111 / x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(3 \cdot \sqrt{x}\right) \cdot \left(y + \left(\frac{0.1111111111111111}{x} + -1\right)\right)
\end{array}
Initial program 99.4%
associate--l+99.4%
sub-neg99.4%
*-commutative99.4%
associate-/r*99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y) :precision binary64 (if (or (<= y -1.0) (not (<= y 3.65e-7))) (* 3.0 (* (sqrt x) y)) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 3.65e-7)) {
tmp = 3.0 * (sqrt(x) * y);
} else {
tmp = sqrt(x) * -3.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-1.0d0)) .or. (.not. (y <= 3.65d-7))) then
tmp = 3.0d0 * (sqrt(x) * y)
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 3.65e-7)) {
tmp = 3.0 * (Math.sqrt(x) * y);
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.0) or not (y <= 3.65e-7): tmp = 3.0 * (math.sqrt(x) * y) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.0) || !(y <= 3.65e-7)) tmp = Float64(3.0 * Float64(sqrt(x) * y)); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.0) || ~((y <= 3.65e-7))) tmp = 3.0 * (sqrt(x) * y); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 3.65e-7]], $MachinePrecision]], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 3.65 \cdot 10^{-7}\right):\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if y < -1 or 3.65e-7 < y Initial program 99.5%
Taylor expanded in y around inf 70.6%
*-commutative70.6%
Simplified70.6%
if -1 < y < 3.65e-7Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-def99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.3%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 50.5%
Taylor expanded in y around 0 49.6%
*-commutative49.6%
Simplified49.6%
Final simplification59.9%
(FPCore (x y) :precision binary64 (if (or (<= y -1.0) (not (<= y 3.65e-7))) (* y (sqrt (* x 9.0))) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 3.65e-7)) {
tmp = y * sqrt((x * 9.0));
} else {
tmp = sqrt(x) * -3.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-1.0d0)) .or. (.not. (y <= 3.65d-7))) then
tmp = y * sqrt((x * 9.0d0))
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 3.65e-7)) {
tmp = y * Math.sqrt((x * 9.0));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.0) or not (y <= 3.65e-7): tmp = y * math.sqrt((x * 9.0)) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.0) || !(y <= 3.65e-7)) tmp = Float64(y * sqrt(Float64(x * 9.0))); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.0) || ~((y <= 3.65e-7))) tmp = y * sqrt((x * 9.0)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 3.65e-7]], $MachinePrecision]], N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 3.65 \cdot 10^{-7}\right):\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
if y < -1 or 3.65e-7 < y Initial program 99.5%
Taylor expanded in y around inf 70.6%
*-commutative70.6%
Simplified70.6%
expm1-log1p-u30.4%
expm1-udef30.4%
*-commutative30.4%
*-commutative30.4%
associate-*r*30.4%
*-commutative30.4%
*-commutative30.4%
metadata-eval30.4%
sqrt-prod30.4%
Applied egg-rr30.4%
expm1-def30.4%
expm1-log1p70.7%
Simplified70.7%
if -1 < y < 3.65e-7Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-def99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.3%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 50.5%
Taylor expanded in y around 0 49.6%
*-commutative49.6%
Simplified49.6%
Final simplification60.0%
(FPCore (x y) :precision binary64 (if (<= y -1.25) (* y (sqrt (* x 9.0))) (if (<= y 3.65e-7) (* (sqrt x) -3.0) (* (* 3.0 (sqrt x)) y))))
double code(double x, double y) {
double tmp;
if (y <= -1.25) {
tmp = y * sqrt((x * 9.0));
} else if (y <= 3.65e-7) {
tmp = sqrt(x) * -3.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) :: tmp
if (y <= (-1.25d0)) then
tmp = y * sqrt((x * 9.0d0))
else if (y <= 3.65d-7) then
tmp = sqrt(x) * (-3.0d0)
else
tmp = (3.0d0 * sqrt(x)) * y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.25) {
tmp = y * Math.sqrt((x * 9.0));
} else if (y <= 3.65e-7) {
tmp = Math.sqrt(x) * -3.0;
} else {
tmp = (3.0 * Math.sqrt(x)) * y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.25: tmp = y * math.sqrt((x * 9.0)) elif y <= 3.65e-7: tmp = math.sqrt(x) * -3.0 else: tmp = (3.0 * math.sqrt(x)) * y return tmp
function code(x, y) tmp = 0.0 if (y <= -1.25) tmp = Float64(y * sqrt(Float64(x * 9.0))); elseif (y <= 3.65e-7) tmp = Float64(sqrt(x) * -3.0); else tmp = Float64(Float64(3.0 * sqrt(x)) * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.25) tmp = y * sqrt((x * 9.0)); elseif (y <= 3.65e-7) tmp = sqrt(x) * -3.0; else tmp = (3.0 * sqrt(x)) * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.25], N[(y * N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.65e-7], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision], N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.25:\\
\;\;\;\;y \cdot \sqrt{x \cdot 9}\\
\mathbf{elif}\;y \leq 3.65 \cdot 10^{-7}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\mathbf{else}:\\
\;\;\;\;\left(3 \cdot \sqrt{x}\right) \cdot y\\
\end{array}
\end{array}
if y < -1.25Initial program 99.5%
Taylor expanded in y around inf 72.0%
*-commutative72.0%
Simplified72.0%
expm1-log1p-u0.1%
expm1-udef0.2%
*-commutative0.2%
*-commutative0.2%
associate-*r*0.2%
*-commutative0.2%
*-commutative0.2%
metadata-eval0.2%
sqrt-prod0.2%
Applied egg-rr0.2%
expm1-def0.1%
expm1-log1p72.2%
Simplified72.2%
if -1.25 < y < 3.65e-7Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-def99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.3%
associate-*r/99.4%
metadata-eval99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 50.5%
Taylor expanded in y around 0 49.6%
*-commutative49.6%
Simplified49.6%
if 3.65e-7 < y Initial program 99.5%
Taylor expanded in y around inf 69.0%
*-commutative69.0%
associate-*l*69.2%
*-commutative69.2%
Simplified69.2%
Final simplification60.0%
(FPCore (x y) :precision binary64 (if (<= x 0.52) (* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0)) (* (sqrt x) (- (* 3.0 y) 3.0))))
double code(double x, double y) {
double tmp;
if (x <= 0.52) {
tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = sqrt(x) * ((3.0 * y) - 3.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 0.52d0) then
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
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 <= 0.52) {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = Math.sqrt(x) * ((3.0 * y) - 3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.52: tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0) else: tmp = math.sqrt(x) * ((3.0 * y) - 3.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.52) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0)); else tmp = Float64(sqrt(x) * Float64(Float64(3.0 * y) - 3.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.52) tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0); else tmp = sqrt(x) * ((3.0 * y) - 3.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.52], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(3.0 * y), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.52:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(3 \cdot y - 3\right)\\
\end{array}
\end{array}
if x < 0.52000000000000002Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-def99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 79.5%
*-commutative79.5%
sub-neg79.5%
associate-*r/79.5%
metadata-eval79.5%
metadata-eval79.5%
Simplified79.5%
if 0.52000000000000002 < x Initial program 99.6%
*-commutative99.6%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-def99.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 98.7%
Final simplification89.6%
(FPCore (x y) :precision binary64 (if (<= x 0.0009) (* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0)) (* (* 3.0 (sqrt x)) (+ y -1.0))))
double code(double x, double y) {
double tmp;
if (x <= 0.0009) {
tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = (3.0 * sqrt(x)) * (y + -1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 0.0009d0) then
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
else
tmp = (3.0d0 * sqrt(x)) * (y + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.0009) {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = (3.0 * Math.sqrt(x)) * (y + -1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.0009: tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0) else: tmp = (3.0 * math.sqrt(x)) * (y + -1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= 0.0009) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0)); else tmp = Float64(Float64(3.0 * sqrt(x)) * Float64(y + -1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.0009) tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0); else tmp = (3.0 * sqrt(x)) * (y + -1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.0009], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0009:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(3 \cdot \sqrt{x}\right) \cdot \left(y + -1\right)\\
\end{array}
\end{array}
if x < 8.9999999999999998e-4Initial program 99.3%
*-commutative99.3%
associate-*l*99.4%
associate--l+99.4%
distribute-lft-in99.4%
fma-def99.4%
sub-neg99.4%
+-commutative99.4%
distribute-lft-in99.4%
metadata-eval99.4%
metadata-eval99.4%
*-commutative99.4%
associate-/r*99.2%
associate-*r/99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 79.5%
*-commutative79.5%
sub-neg79.5%
associate-*r/79.5%
metadata-eval79.5%
metadata-eval79.5%
Simplified79.5%
if 8.9999999999999998e-4 < x Initial program 99.6%
Taylor expanded in y around inf 98.8%
Final simplification89.6%
(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-def99.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 x around inf 61.5%
Taylor expanded in y around 0 26.5%
*-commutative26.5%
Simplified26.5%
add-sqr-sqrt0.0%
sqrt-unprod3.4%
swap-sqr3.4%
add-sqr-sqrt3.4%
metadata-eval3.4%
pow1/23.4%
Applied egg-rr3.4%
unpow1/23.4%
Simplified3.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.4%
*-commutative99.4%
associate-*l*99.5%
associate--l+99.5%
distribute-lft-in99.5%
fma-def99.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 x around inf 61.5%
Taylor expanded in y around 0 26.5%
*-commutative26.5%
Simplified26.5%
Final simplification26.5%
(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 2023268
(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)))