
(FPCore (x y) :precision binary64 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
double code(double x, double y) {
return (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (3.0d0 * sqrt(x)) * ((y + (1.0d0 / (x * 9.0d0))) - 1.0d0)
end function
public static double code(double x, double y) {
return (3.0 * Math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
def code(x, y): return (3.0 * math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0)
function code(x, y) return Float64(Float64(3.0 * sqrt(x)) * Float64(Float64(y + Float64(1.0 / Float64(x * 9.0))) - 1.0)) end
function tmp = code(x, y) tmp = (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0); end
code[x_, y_] := N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* (* 3.0 (sqrt x)) (- (+ y (/ 1.0 (* x 9.0))) 1.0)))
double code(double x, double y) {
return (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (3.0d0 * sqrt(x)) * ((y + (1.0d0 / (x * 9.0d0))) - 1.0d0)
end function
public static double code(double x, double y) {
return (3.0 * Math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0);
}
def code(x, y): return (3.0 * math.sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0)
function code(x, y) return Float64(Float64(3.0 * sqrt(x)) * Float64(Float64(y + Float64(1.0 / Float64(x * 9.0))) - 1.0)) end
function tmp = code(x, y) tmp = (3.0 * sqrt(x)) * ((y + (1.0 / (x * 9.0))) - 1.0); end
code[x_, y_] := N[(N[(3.0 * N[Sqrt[x], $MachinePrecision]), $MachinePrecision] * N[(N[(y + N[(1.0 / N[(x * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(3 \cdot \sqrt{x}\right) \cdot \left(\left(y + \frac{1}{x \cdot 9}\right) - 1\right)
\end{array}
(FPCore (x y) :precision binary64 (* (sqrt (* x 9.0)) (+ (+ 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}
(FPCore (x y)
:precision binary64
(if (<= y -3.7e+37)
(* (sqrt (* x 9.0)) y)
(if (<= y 4.5e+114)
(* 3.0 (* (sqrt x) (+ (/ 0.1111111111111111 x) -1.0)))
(* (sqrt x) (- (* y 3.0) 3.0)))))
double code(double x, double y) {
double tmp;
if (y <= -3.7e+37) {
tmp = sqrt((x * 9.0)) * y;
} else if (y <= 4.5e+114) {
tmp = 3.0 * (sqrt(x) * ((0.1111111111111111 / x) + -1.0));
} else {
tmp = sqrt(x) * ((y * 3.0) - 3.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-3.7d+37)) then
tmp = sqrt((x * 9.0d0)) * y
else if (y <= 4.5d+114) then
tmp = 3.0d0 * (sqrt(x) * ((0.1111111111111111d0 / x) + (-1.0d0)))
else
tmp = sqrt(x) * ((y * 3.0d0) - 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.7e+37) {
tmp = Math.sqrt((x * 9.0)) * y;
} else if (y <= 4.5e+114) {
tmp = 3.0 * (Math.sqrt(x) * ((0.1111111111111111 / x) + -1.0));
} else {
tmp = Math.sqrt(x) * ((y * 3.0) - 3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.7e+37: tmp = math.sqrt((x * 9.0)) * y elif y <= 4.5e+114: tmp = 3.0 * (math.sqrt(x) * ((0.1111111111111111 / x) + -1.0)) else: tmp = math.sqrt(x) * ((y * 3.0) - 3.0) return tmp
function code(x, y) tmp = 0.0 if (y <= -3.7e+37) tmp = Float64(sqrt(Float64(x * 9.0)) * y); elseif (y <= 4.5e+114) tmp = Float64(3.0 * Float64(sqrt(x) * Float64(Float64(0.1111111111111111 / x) + -1.0))); else tmp = Float64(sqrt(x) * Float64(Float64(y * 3.0) - 3.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.7e+37) tmp = sqrt((x * 9.0)) * y; elseif (y <= 4.5e+114) tmp = 3.0 * (sqrt(x) * ((0.1111111111111111 / x) + -1.0)); else tmp = sqrt(x) * ((y * 3.0) - 3.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.7e+37], N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 4.5e+114], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.1111111111111111 / x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(y * 3.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.7 \cdot 10^{+37}:\\
\;\;\;\;\sqrt{x \cdot 9} \cdot y\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+114}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot \left(\frac{0.1111111111111111}{x} + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3 - 3\right)\\
\end{array}
\end{array}
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (* x 9.0))))
(if (<= y -1.2e+38)
(* t_0 y)
(if (<= y 4.5e+114)
(* t_0 (+ (/ 0.1111111111111111 x) -1.0))
(* (sqrt x) (- (* y 3.0) 3.0))))))
double code(double x, double y) {
double t_0 = sqrt((x * 9.0));
double tmp;
if (y <= -1.2e+38) {
tmp = t_0 * y;
} else if (y <= 4.5e+114) {
tmp = t_0 * ((0.1111111111111111 / x) + -1.0);
} 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) :: t_0
real(8) :: tmp
t_0 = sqrt((x * 9.0d0))
if (y <= (-1.2d+38)) then
tmp = t_0 * y
else if (y <= 4.5d+114) then
tmp = t_0 * ((0.1111111111111111d0 / x) + (-1.0d0))
else
tmp = sqrt(x) * ((y * 3.0d0) - 3.0d0)
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 (y <= -1.2e+38) {
tmp = t_0 * y;
} else if (y <= 4.5e+114) {
tmp = t_0 * ((0.1111111111111111 / x) + -1.0);
} else {
tmp = Math.sqrt(x) * ((y * 3.0) - 3.0);
}
return tmp;
}
def code(x, y): t_0 = math.sqrt((x * 9.0)) tmp = 0 if y <= -1.2e+38: tmp = t_0 * y elif y <= 4.5e+114: tmp = t_0 * ((0.1111111111111111 / x) + -1.0) else: tmp = math.sqrt(x) * ((y * 3.0) - 3.0) return tmp
function code(x, y) t_0 = sqrt(Float64(x * 9.0)) tmp = 0.0 if (y <= -1.2e+38) tmp = Float64(t_0 * y); elseif (y <= 4.5e+114) tmp = Float64(t_0 * Float64(Float64(0.1111111111111111 / x) + -1.0)); else tmp = Float64(sqrt(x) * Float64(Float64(y * 3.0) - 3.0)); end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt((x * 9.0)); tmp = 0.0; if (y <= -1.2e+38) tmp = t_0 * y; elseif (y <= 4.5e+114) tmp = t_0 * ((0.1111111111111111 / x) + -1.0); else tmp = sqrt(x) * ((y * 3.0) - 3.0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -1.2e+38], N[(t$95$0 * y), $MachinePrecision], If[LessEqual[y, 4.5e+114], N[(t$95$0 * N[(N[(0.1111111111111111 / x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(y * 3.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x \cdot 9}\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{+38}:\\
\;\;\;\;t_0 \cdot y\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+114}:\\
\;\;\;\;t_0 \cdot \left(\frac{0.1111111111111111}{x} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3 - 3\right)\\
\end{array}
\end{array}
(FPCore (x y)
:precision binary64
(if (<= y -4.2e+38)
(* (sqrt (* x 9.0)) y)
(if (<= y 4.5e+114)
(* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))
(* (sqrt x) (* y 3.0)))))
double code(double x, double y) {
double tmp;
if (y <= -4.2e+38) {
tmp = sqrt((x * 9.0)) * y;
} else if (y <= 4.5e+114) {
tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = sqrt(x) * (y * 3.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-4.2d+38)) then
tmp = sqrt((x * 9.0d0)) * y
else if (y <= 4.5d+114) then
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
else
tmp = sqrt(x) * (y * 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -4.2e+38) {
tmp = Math.sqrt((x * 9.0)) * y;
} else if (y <= 4.5e+114) {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = Math.sqrt(x) * (y * 3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -4.2e+38: tmp = math.sqrt((x * 9.0)) * y elif y <= 4.5e+114: tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0) else: tmp = math.sqrt(x) * (y * 3.0) return tmp
function code(x, y) tmp = 0.0 if (y <= -4.2e+38) tmp = Float64(sqrt(Float64(x * 9.0)) * y); elseif (y <= 4.5e+114) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0)); else tmp = Float64(sqrt(x) * Float64(y * 3.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -4.2e+38) tmp = sqrt((x * 9.0)) * y; elseif (y <= 4.5e+114) tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0); else tmp = sqrt(x) * (y * 3.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -4.2e+38], N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 4.5e+114], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+38}:\\
\;\;\;\;\sqrt{x \cdot 9} \cdot y\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+114}:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3\right)\\
\end{array}
\end{array}
(FPCore (x y)
:precision binary64
(if (<= y -7e+37)
(* (sqrt (* x 9.0)) y)
(if (<= y 4.5e+114)
(* (sqrt x) (+ (/ 0.3333333333333333 x) -3.0))
(* (sqrt x) (- (* y 3.0) 3.0)))))
double code(double x, double y) {
double tmp;
if (y <= -7e+37) {
tmp = sqrt((x * 9.0)) * y;
} else if (y <= 4.5e+114) {
tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = sqrt(x) * ((y * 3.0) - 3.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-7d+37)) then
tmp = sqrt((x * 9.0d0)) * y
else if (y <= 4.5d+114) then
tmp = sqrt(x) * ((0.3333333333333333d0 / x) + (-3.0d0))
else
tmp = sqrt(x) * ((y * 3.0d0) - 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -7e+37) {
tmp = Math.sqrt((x * 9.0)) * y;
} else if (y <= 4.5e+114) {
tmp = Math.sqrt(x) * ((0.3333333333333333 / x) + -3.0);
} else {
tmp = Math.sqrt(x) * ((y * 3.0) - 3.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -7e+37: tmp = math.sqrt((x * 9.0)) * y elif y <= 4.5e+114: tmp = math.sqrt(x) * ((0.3333333333333333 / x) + -3.0) else: tmp = math.sqrt(x) * ((y * 3.0) - 3.0) return tmp
function code(x, y) tmp = 0.0 if (y <= -7e+37) tmp = Float64(sqrt(Float64(x * 9.0)) * y); elseif (y <= 4.5e+114) tmp = Float64(sqrt(x) * Float64(Float64(0.3333333333333333 / x) + -3.0)); else tmp = Float64(sqrt(x) * Float64(Float64(y * 3.0) - 3.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -7e+37) tmp = sqrt((x * 9.0)) * y; elseif (y <= 4.5e+114) tmp = sqrt(x) * ((0.3333333333333333 / x) + -3.0); else tmp = sqrt(x) * ((y * 3.0) - 3.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -7e+37], N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 4.5e+114], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(0.3333333333333333 / x), $MachinePrecision] + -3.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * N[(N[(y * 3.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+37}:\\
\;\;\;\;\sqrt{x \cdot 9} \cdot y\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+114}:\\
\;\;\;\;\sqrt{x} \cdot \left(\frac{0.3333333333333333}{x} + -3\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot \left(y \cdot 3 - 3\right)\\
\end{array}
\end{array}
(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}
(FPCore (x y) :precision binary64 (* (sqrt (* x 9.0)) (+ (+ y (/ 0.1111111111111111 x)) -1.0)))
double code(double x, double y) {
return sqrt((x * 9.0)) * ((y + (0.1111111111111111 / x)) + -1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sqrt((x * 9.0d0)) * ((y + (0.1111111111111111d0 / x)) + (-1.0d0))
end function
public static double code(double x, double y) {
return Math.sqrt((x * 9.0)) * ((y + (0.1111111111111111 / x)) + -1.0);
}
def code(x, y): return math.sqrt((x * 9.0)) * ((y + (0.1111111111111111 / x)) + -1.0)
function code(x, y) return Float64(sqrt(Float64(x * 9.0)) * Float64(Float64(y + Float64(0.1111111111111111 / x)) + -1.0)) end
function tmp = code(x, y) tmp = sqrt((x * 9.0)) * ((y + (0.1111111111111111 / x)) + -1.0); end
code[x_, y_] := N[(N[Sqrt[N[(x * 9.0), $MachinePrecision]], $MachinePrecision] * N[(N[(y + N[(0.1111111111111111 / x), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sqrt{x \cdot 9} \cdot \left(\left(y + \frac{0.1111111111111111}{x}\right) + -1\right)
\end{array}
(FPCore (x y) :precision binary64 (if (<= x 1e-15) (sqrt (/ 0.1111111111111111 x)) (if (<= x 1750000.0) (* 3.0 (* y (sqrt x))) (* (sqrt x) -3.0))))
double code(double x, double y) {
double tmp;
if (x <= 1e-15) {
tmp = sqrt((0.1111111111111111 / x));
} else if (x <= 1750000.0) {
tmp = 3.0 * (y * sqrt(x));
} else {
tmp = sqrt(x) * -3.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1d-15) then
tmp = sqrt((0.1111111111111111d0 / x))
else if (x <= 1750000.0d0) then
tmp = 3.0d0 * (y * sqrt(x))
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1e-15) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else if (x <= 1750000.0) {
tmp = 3.0 * (y * Math.sqrt(x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1e-15: tmp = math.sqrt((0.1111111111111111 / x)) elif x <= 1750000.0: tmp = 3.0 * (y * math.sqrt(x)) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 1e-15) tmp = sqrt(Float64(0.1111111111111111 / x)); elseif (x <= 1750000.0) tmp = Float64(3.0 * Float64(y * sqrt(x))); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1e-15) tmp = sqrt((0.1111111111111111 / x)); elseif (x <= 1750000.0) tmp = 3.0 * (y * sqrt(x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1e-15], N[Sqrt[N[(0.1111111111111111 / x), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 1750000.0], N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{-15}:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{elif}\;x \leq 1750000:\\
\;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (<= x 8.5e-16) (/ (sqrt x) (* x 3.0)) (if (<= x 6000000.0) (* 3.0 (* y (sqrt x))) (* (sqrt x) -3.0))))
double code(double x, double y) {
double tmp;
if (x <= 8.5e-16) {
tmp = sqrt(x) / (x * 3.0);
} else if (x <= 6000000.0) {
tmp = 3.0 * (y * sqrt(x));
} else {
tmp = sqrt(x) * -3.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 8.5d-16) then
tmp = sqrt(x) / (x * 3.0d0)
else if (x <= 6000000.0d0) then
tmp = 3.0d0 * (y * sqrt(x))
else
tmp = sqrt(x) * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 8.5e-16) {
tmp = Math.sqrt(x) / (x * 3.0);
} else if (x <= 6000000.0) {
tmp = 3.0 * (y * Math.sqrt(x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 8.5e-16: tmp = math.sqrt(x) / (x * 3.0) elif x <= 6000000.0: tmp = 3.0 * (y * math.sqrt(x)) else: tmp = math.sqrt(x) * -3.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 8.5e-16) tmp = Float64(sqrt(x) / Float64(x * 3.0)); elseif (x <= 6000000.0) tmp = Float64(3.0 * Float64(y * sqrt(x))); else tmp = Float64(sqrt(x) * -3.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 8.5e-16) tmp = sqrt(x) / (x * 3.0); elseif (x <= 6000000.0) tmp = 3.0 * (y * sqrt(x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 8.5e-16], N[(N[Sqrt[x], $MachinePrecision] / N[(x * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6000000.0], N[(3.0 * N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.5 \cdot 10^{-16}:\\
\;\;\;\;\frac{\sqrt{x}}{x \cdot 3}\\
\mathbf{elif}\;x \leq 6000000:\\
\;\;\;\;3 \cdot \left(y \cdot \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (<= x 3.8e-16) (/ (sqrt x) (* x 3.0)) (* 3.0 (* (sqrt x) (+ y -1.0)))))
double code(double x, double y) {
double tmp;
if (x <= 3.8e-16) {
tmp = sqrt(x) / (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 <= 3.8d-16) then
tmp = sqrt(x) / (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 <= 3.8e-16) {
tmp = Math.sqrt(x) / (x * 3.0);
} else {
tmp = 3.0 * (Math.sqrt(x) * (y + -1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 3.8e-16: tmp = math.sqrt(x) / (x * 3.0) else: tmp = 3.0 * (math.sqrt(x) * (y + -1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= 3.8e-16) tmp = Float64(sqrt(x) / Float64(x * 3.0)); else tmp = Float64(3.0 * Float64(sqrt(x) * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 3.8e-16) tmp = sqrt(x) / (x * 3.0); else tmp = 3.0 * (sqrt(x) * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 3.8e-16], N[(N[Sqrt[x], $MachinePrecision] / N[(x * 3.0), $MachinePrecision]), $MachinePrecision], N[(3.0 * N[(N[Sqrt[x], $MachinePrecision] * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.8 \cdot 10^{-16}:\\
\;\;\;\;\frac{\sqrt{x}}{x \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(\sqrt{x} \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
(FPCore (x y) :precision binary64 (if (<= x 0.052) (sqrt (/ 0.1111111111111111 x)) (* (sqrt x) -3.0)))
double code(double x, double y) {
double tmp;
if (x <= 0.052) {
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.052d0) 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.052) {
tmp = Math.sqrt((0.1111111111111111 / x));
} else {
tmp = Math.sqrt(x) * -3.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.052: 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.052) 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.052) tmp = sqrt((0.1111111111111111 / x)); else tmp = sqrt(x) * -3.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.052], 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.052:\\
\;\;\;\;\sqrt{\frac{0.1111111111111111}{x}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot -3\\
\end{array}
\end{array}
(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}
(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 2023350
(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)))