
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y): return (1.0 - x) + (y * math.sqrt(x))
function code(x, y) return Float64(Float64(1.0 - x) + Float64(y * sqrt(x))) end
function tmp = code(x, y) tmp = (1.0 - x) + (y * sqrt(x)); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) + y \cdot \sqrt{x}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* y (sqrt x))))
double code(double x, double y) {
return (1.0 - x) + (y * sqrt(x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) + (y * sqrt(x))
end function
public static double code(double x, double y) {
return (1.0 - x) + (y * Math.sqrt(x));
}
def code(x, y): return (1.0 - x) + (y * math.sqrt(x))
function code(x, y) return Float64(Float64(1.0 - x) + Float64(y * sqrt(x))) end
function tmp = code(x, y) tmp = (1.0 - x) + (y * sqrt(x)); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) + y \cdot \sqrt{x}
\end{array}
(FPCore (x y) :precision binary64 (fma (sqrt x) y (- 1.0 x)))
double code(double x, double y) {
return fma(sqrt(x), y, (1.0 - x));
}
function code(x, y) return fma(sqrt(x), y, Float64(1.0 - x)) end
code[x_, y_] := N[(N[Sqrt[x], $MachinePrecision] * y + N[(1.0 - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\sqrt{x}, y, 1 - x\right)
\end{array}
Initial program 99.9%
+-commutativeN/A
*-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ 1.0 (* (sqrt x) y)))) (if (<= y -7.2e+49) t_0 (if (<= y 5e+60) (- 1.0 x) t_0))))
double code(double x, double y) {
double t_0 = 1.0 + (sqrt(x) * y);
double tmp;
if (y <= -7.2e+49) {
tmp = t_0;
} else if (y <= 5e+60) {
tmp = 1.0 - x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (sqrt(x) * y)
if (y <= (-7.2d+49)) then
tmp = t_0
else if (y <= 5d+60) then
tmp = 1.0d0 - x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 + (Math.sqrt(x) * y);
double tmp;
if (y <= -7.2e+49) {
tmp = t_0;
} else if (y <= 5e+60) {
tmp = 1.0 - x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (math.sqrt(x) * y) tmp = 0 if y <= -7.2e+49: tmp = t_0 elif y <= 5e+60: tmp = 1.0 - x else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(sqrt(x) * y)) tmp = 0.0 if (y <= -7.2e+49) tmp = t_0; elseif (y <= 5e+60) tmp = Float64(1.0 - x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (sqrt(x) * y); tmp = 0.0; if (y <= -7.2e+49) tmp = t_0; elseif (y <= 5e+60) tmp = 1.0 - x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e+49], t$95$0, If[LessEqual[y, 5e+60], N[(1.0 - x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + \sqrt{x} \cdot y\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{+49}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+60}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -7.19999999999999993e49 or 4.99999999999999975e60 < y Initial program 99.7%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6491.5%
Simplified91.5%
if -7.19999999999999993e49 < y < 4.99999999999999975e60Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6495.9%
Simplified95.9%
(FPCore (x y) :precision binary64 (let* ((t_0 (* (sqrt x) y))) (if (<= y -7.8e+49) t_0 (if (<= y 2.8e+64) (- 1.0 x) t_0))))
double code(double x, double y) {
double t_0 = sqrt(x) * y;
double tmp;
if (y <= -7.8e+49) {
tmp = t_0;
} else if (y <= 2.8e+64) {
tmp = 1.0 - x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt(x) * y
if (y <= (-7.8d+49)) then
tmp = t_0
else if (y <= 2.8d+64) then
tmp = 1.0d0 - x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt(x) * y;
double tmp;
if (y <= -7.8e+49) {
tmp = t_0;
} else if (y <= 2.8e+64) {
tmp = 1.0 - x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = math.sqrt(x) * y tmp = 0 if y <= -7.8e+49: tmp = t_0 elif y <= 2.8e+64: tmp = 1.0 - x else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(sqrt(x) * y) tmp = 0.0 if (y <= -7.8e+49) tmp = t_0; elseif (y <= 2.8e+64) tmp = Float64(1.0 - x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = sqrt(x) * y; tmp = 0.0; if (y <= -7.8e+49) tmp = t_0; elseif (y <= 2.8e+64) tmp = 1.0 - x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -7.8e+49], t$95$0, If[LessEqual[y, 2.8e+64], N[(1.0 - x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{x} \cdot y\\
\mathbf{if}\;y \leq -7.8 \cdot 10^{+49}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+64}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -7.8000000000000002e49 or 2.80000000000000024e64 < y Initial program 99.7%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6487.7%
Simplified87.7%
if -7.8000000000000002e49 < y < 2.80000000000000024e64Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6495.9%
Simplified95.9%
(FPCore (x y) :precision binary64 (+ (- 1.0 x) (* (sqrt x) y)))
double code(double x, double y) {
return (1.0 - x) + (sqrt(x) * y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 - x) + (sqrt(x) * y)
end function
public static double code(double x, double y) {
return (1.0 - x) + (Math.sqrt(x) * y);
}
def code(x, y): return (1.0 - x) + (math.sqrt(x) * y)
function code(x, y) return Float64(Float64(1.0 - x) + Float64(sqrt(x) * y)) end
function tmp = code(x, y) tmp = (1.0 - x) + (sqrt(x) * y); end
code[x_, y_] := N[(N[(1.0 - x), $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) + \sqrt{x} \cdot y
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y) :precision binary64 (if (<= y -3.8e+133) (* (- 1.0 (* x x)) (+ 1.0 (* x (+ x -1.0)))) (if (<= y 4.1e+136) (- 1.0 x) (* (- 1.0 x) (- 1.0 (* x (* x x)))))))
double code(double x, double y) {
double tmp;
if (y <= -3.8e+133) {
tmp = (1.0 - (x * x)) * (1.0 + (x * (x + -1.0)));
} else if (y <= 4.1e+136) {
tmp = 1.0 - x;
} else {
tmp = (1.0 - x) * (1.0 - (x * (x * x)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-3.8d+133)) then
tmp = (1.0d0 - (x * x)) * (1.0d0 + (x * (x + (-1.0d0))))
else if (y <= 4.1d+136) then
tmp = 1.0d0 - x
else
tmp = (1.0d0 - x) * (1.0d0 - (x * (x * x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.8e+133) {
tmp = (1.0 - (x * x)) * (1.0 + (x * (x + -1.0)));
} else if (y <= 4.1e+136) {
tmp = 1.0 - x;
} else {
tmp = (1.0 - x) * (1.0 - (x * (x * x)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.8e+133: tmp = (1.0 - (x * x)) * (1.0 + (x * (x + -1.0))) elif y <= 4.1e+136: tmp = 1.0 - x else: tmp = (1.0 - x) * (1.0 - (x * (x * x))) return tmp
function code(x, y) tmp = 0.0 if (y <= -3.8e+133) tmp = Float64(Float64(1.0 - Float64(x * x)) * Float64(1.0 + Float64(x * Float64(x + -1.0)))); elseif (y <= 4.1e+136) tmp = Float64(1.0 - x); else tmp = Float64(Float64(1.0 - x) * Float64(1.0 - Float64(x * Float64(x * x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.8e+133) tmp = (1.0 - (x * x)) * (1.0 + (x * (x + -1.0))); elseif (y <= 4.1e+136) tmp = 1.0 - x; else tmp = (1.0 - x) * (1.0 - (x * (x * x))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.8e+133], N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(x * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e+136], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 - N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+133}:\\
\;\;\;\;\left(1 - x \cdot x\right) \cdot \left(1 + x \cdot \left(x + -1\right)\right)\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{+136}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;\left(1 - x\right) \cdot \left(1 - x \cdot \left(x \cdot x\right)\right)\\
\end{array}
\end{array}
if y < -3.8000000000000002e133Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f643.1%
Simplified3.1%
flip--N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6423.1%
Applied egg-rr23.1%
Taylor expanded in x around 0
+-lowering-+.f64N/A
sub-negN/A
remove-double-negN/A
mul-1-negN/A
distribute-neg-inN/A
+-commutativeN/A
mul-1-negN/A
*-lowering-*.f64N/A
distribute-lft-inN/A
metadata-evalN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f6429.2%
Simplified29.2%
if -3.8000000000000002e133 < y < 4.0999999999999998e136Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6486.5%
Simplified86.5%
if 4.0999999999999998e136 < y Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f644.4%
Simplified4.4%
flip3--N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
--lowering--.f64N/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f644.3%
Applied egg-rr4.3%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6422.9%
Simplified22.9%
Final simplification69.9%
(FPCore (x y) :precision binary64 (let* ((t_0 (- 1.0 (* x (* x x))))) (if (<= y -3.8e+133) t_0 (if (<= y 3e+137) (- 1.0 x) (* (- 1.0 x) t_0)))))
double code(double x, double y) {
double t_0 = 1.0 - (x * (x * x));
double tmp;
if (y <= -3.8e+133) {
tmp = t_0;
} else if (y <= 3e+137) {
tmp = 1.0 - x;
} else {
tmp = (1.0 - x) * t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 - (x * (x * x))
if (y <= (-3.8d+133)) then
tmp = t_0
else if (y <= 3d+137) then
tmp = 1.0d0 - x
else
tmp = (1.0d0 - x) * t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 - (x * (x * x));
double tmp;
if (y <= -3.8e+133) {
tmp = t_0;
} else if (y <= 3e+137) {
tmp = 1.0 - x;
} else {
tmp = (1.0 - x) * t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (x * (x * x)) tmp = 0 if y <= -3.8e+133: tmp = t_0 elif y <= 3e+137: tmp = 1.0 - x else: tmp = (1.0 - x) * t_0 return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(x * Float64(x * x))) tmp = 0.0 if (y <= -3.8e+133) tmp = t_0; elseif (y <= 3e+137) tmp = Float64(1.0 - x); else tmp = Float64(Float64(1.0 - x) * t_0); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (x * (x * x)); tmp = 0.0; if (y <= -3.8e+133) tmp = t_0; elseif (y <= 3e+137) tmp = 1.0 - x; else tmp = (1.0 - x) * t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.8e+133], t$95$0, If[LessEqual[y, 3e+137], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - x \cdot \left(x \cdot x\right)\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{+133}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+137}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;\left(1 - x\right) \cdot t\_0\\
\end{array}
\end{array}
if y < -3.8000000000000002e133Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f643.1%
Simplified3.1%
flip3--N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
--lowering--.f64N/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f644.4%
Applied egg-rr4.4%
Taylor expanded in x around 0
Simplified26.4%
if -3.8000000000000002e133 < y < 3.0000000000000001e137Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6486.5%
Simplified86.5%
if 3.0000000000000001e137 < y Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f644.4%
Simplified4.4%
flip3--N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
--lowering--.f64N/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f644.3%
Applied egg-rr4.3%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6422.9%
Simplified22.9%
Final simplification69.5%
(FPCore (x y) :precision binary64 (if (<= y -3.8e+133) (- 1.0 (* x (* x x))) (if (<= y 1.3e+138) (- 1.0 x) (* (- 1.0 x) (- 1.0 (* x x))))))
double code(double x, double y) {
double tmp;
if (y <= -3.8e+133) {
tmp = 1.0 - (x * (x * x));
} else if (y <= 1.3e+138) {
tmp = 1.0 - x;
} else {
tmp = (1.0 - x) * (1.0 - (x * x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-3.8d+133)) then
tmp = 1.0d0 - (x * (x * x))
else if (y <= 1.3d+138) then
tmp = 1.0d0 - x
else
tmp = (1.0d0 - x) * (1.0d0 - (x * x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.8e+133) {
tmp = 1.0 - (x * (x * x));
} else if (y <= 1.3e+138) {
tmp = 1.0 - x;
} else {
tmp = (1.0 - x) * (1.0 - (x * x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.8e+133: tmp = 1.0 - (x * (x * x)) elif y <= 1.3e+138: tmp = 1.0 - x else: tmp = (1.0 - x) * (1.0 - (x * x)) return tmp
function code(x, y) tmp = 0.0 if (y <= -3.8e+133) tmp = Float64(1.0 - Float64(x * Float64(x * x))); elseif (y <= 1.3e+138) tmp = Float64(1.0 - x); else tmp = Float64(Float64(1.0 - x) * Float64(1.0 - Float64(x * x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.8e+133) tmp = 1.0 - (x * (x * x)); elseif (y <= 1.3e+138) tmp = 1.0 - x; else tmp = (1.0 - x) * (1.0 - (x * x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.8e+133], N[(1.0 - N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e+138], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+133}:\\
\;\;\;\;1 - x \cdot \left(x \cdot x\right)\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+138}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;\left(1 - x\right) \cdot \left(1 - x \cdot x\right)\\
\end{array}
\end{array}
if y < -3.8000000000000002e133Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f643.1%
Simplified3.1%
flip3--N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
--lowering--.f64N/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f644.4%
Applied egg-rr4.4%
Taylor expanded in x around 0
Simplified26.4%
if -3.8000000000000002e133 < y < 1.3e138Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6486.4%
Simplified86.4%
if 1.3e138 < y Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f642.4%
Simplified2.4%
flip--N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f642.4%
Applied egg-rr2.4%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6421.1%
Simplified21.1%
Final simplification69.5%
(FPCore (x y) :precision binary64 (if (<= y -5.5e+124) (/ (* x x) (- 0.0 x)) (if (<= y 3.2e+138) (- 1.0 x) (* (- 1.0 x) (- 1.0 (* x x))))))
double code(double x, double y) {
double tmp;
if (y <= -5.5e+124) {
tmp = (x * x) / (0.0 - x);
} else if (y <= 3.2e+138) {
tmp = 1.0 - x;
} else {
tmp = (1.0 - x) * (1.0 - (x * x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-5.5d+124)) then
tmp = (x * x) / (0.0d0 - x)
else if (y <= 3.2d+138) then
tmp = 1.0d0 - x
else
tmp = (1.0d0 - x) * (1.0d0 - (x * x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -5.5e+124) {
tmp = (x * x) / (0.0 - x);
} else if (y <= 3.2e+138) {
tmp = 1.0 - x;
} else {
tmp = (1.0 - x) * (1.0 - (x * x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -5.5e+124: tmp = (x * x) / (0.0 - x) elif y <= 3.2e+138: tmp = 1.0 - x else: tmp = (1.0 - x) * (1.0 - (x * x)) return tmp
function code(x, y) tmp = 0.0 if (y <= -5.5e+124) tmp = Float64(Float64(x * x) / Float64(0.0 - x)); elseif (y <= 3.2e+138) tmp = Float64(1.0 - x); else tmp = Float64(Float64(1.0 - x) * Float64(1.0 - Float64(x * x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -5.5e+124) tmp = (x * x) / (0.0 - x); elseif (y <= 3.2e+138) tmp = 1.0 - x; else tmp = (1.0 - x) * (1.0 - (x * x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -5.5e+124], N[(N[(x * x), $MachinePrecision] / N[(0.0 - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+138], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+124}:\\
\;\;\;\;\frac{x \cdot x}{0 - x}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+138}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;\left(1 - x\right) \cdot \left(1 - x \cdot x\right)\\
\end{array}
\end{array}
if y < -5.49999999999999977e124Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f643.1%
Simplified3.1%
Taylor expanded in x around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f644.4%
Simplified4.4%
flip--N/A
metadata-evalN/A
neg-sub0N/A
+-lft-identityN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6423.2%
Applied egg-rr23.2%
if -5.49999999999999977e124 < y < 3.2000000000000001e138Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6487.3%
Simplified87.3%
if 3.2000000000000001e138 < y Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f642.4%
Simplified2.4%
flip--N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f642.4%
Applied egg-rr2.4%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6421.1%
Simplified21.1%
Final simplification69.2%
(FPCore (x y) :precision binary64 (if (<= y -5.5e+124) (/ (* x x) (- 0.0 x)) (if (<= y 4.6e+138) (- 1.0 x) (* (* x x) (* x x)))))
double code(double x, double y) {
double tmp;
if (y <= -5.5e+124) {
tmp = (x * x) / (0.0 - x);
} else if (y <= 4.6e+138) {
tmp = 1.0 - x;
} else {
tmp = (x * x) * (x * x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-5.5d+124)) then
tmp = (x * x) / (0.0d0 - x)
else if (y <= 4.6d+138) then
tmp = 1.0d0 - x
else
tmp = (x * x) * (x * x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -5.5e+124) {
tmp = (x * x) / (0.0 - x);
} else if (y <= 4.6e+138) {
tmp = 1.0 - x;
} else {
tmp = (x * x) * (x * x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -5.5e+124: tmp = (x * x) / (0.0 - x) elif y <= 4.6e+138: tmp = 1.0 - x else: tmp = (x * x) * (x * x) return tmp
function code(x, y) tmp = 0.0 if (y <= -5.5e+124) tmp = Float64(Float64(x * x) / Float64(0.0 - x)); elseif (y <= 4.6e+138) tmp = Float64(1.0 - x); else tmp = Float64(Float64(x * x) * Float64(x * x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -5.5e+124) tmp = (x * x) / (0.0 - x); elseif (y <= 4.6e+138) tmp = 1.0 - x; else tmp = (x * x) * (x * x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -5.5e+124], N[(N[(x * x), $MachinePrecision] / N[(0.0 - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e+138], N[(1.0 - x), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{+124}:\\
\;\;\;\;\frac{x \cdot x}{0 - x}\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+138}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot x\right)\\
\end{array}
\end{array}
if y < -5.49999999999999977e124Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f643.1%
Simplified3.1%
Taylor expanded in x around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f644.4%
Simplified4.4%
flip--N/A
metadata-evalN/A
neg-sub0N/A
+-lft-identityN/A
/-lowering-/.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f6423.2%
Applied egg-rr23.2%
if -5.49999999999999977e124 < y < 4.60000000000000015e138Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6487.3%
Simplified87.3%
if 4.60000000000000015e138 < y Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f642.4%
Simplified2.4%
flip3--N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
--lowering--.f64N/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f642.3%
Applied egg-rr2.3%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6421.5%
Simplified21.5%
Taylor expanded in x around inf
metadata-evalN/A
pow-plusN/A
unpow3N/A
unpow2N/A
associate-*l*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6420.4%
Simplified20.4%
Final simplification69.1%
(FPCore (x y) :precision binary64 (if (<= y -1.45e+126) (- 1.0 (* x x)) (if (<= y 1.2e+138) (- 1.0 x) (* (* x x) (* x x)))))
double code(double x, double y) {
double tmp;
if (y <= -1.45e+126) {
tmp = 1.0 - (x * x);
} else if (y <= 1.2e+138) {
tmp = 1.0 - x;
} else {
tmp = (x * x) * (x * x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.45d+126)) then
tmp = 1.0d0 - (x * x)
else if (y <= 1.2d+138) then
tmp = 1.0d0 - x
else
tmp = (x * x) * (x * x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.45e+126) {
tmp = 1.0 - (x * x);
} else if (y <= 1.2e+138) {
tmp = 1.0 - x;
} else {
tmp = (x * x) * (x * x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.45e+126: tmp = 1.0 - (x * x) elif y <= 1.2e+138: tmp = 1.0 - x else: tmp = (x * x) * (x * x) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.45e+126) tmp = Float64(1.0 - Float64(x * x)); elseif (y <= 1.2e+138) tmp = Float64(1.0 - x); else tmp = Float64(Float64(x * x) * Float64(x * x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.45e+126) tmp = 1.0 - (x * x); elseif (y <= 1.2e+138) tmp = 1.0 - x; else tmp = (x * x) * (x * x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.45e+126], N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+138], N[(1.0 - x), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+126}:\\
\;\;\;\;1 - x \cdot x\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+138}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot x\right)\\
\end{array}
\end{array}
if y < -1.44999999999999993e126Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f643.2%
Simplified3.2%
flip--N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f6422.6%
Applied egg-rr22.6%
Taylor expanded in x around 0
Simplified23.6%
if -1.44999999999999993e126 < y < 1.2e138Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6486.8%
Simplified86.8%
if 1.2e138 < y Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f642.4%
Simplified2.4%
flip3--N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
--lowering--.f64N/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f642.3%
Applied egg-rr2.3%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6421.5%
Simplified21.5%
Taylor expanded in x around inf
metadata-evalN/A
pow-plusN/A
unpow3N/A
unpow2N/A
associate-*l*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6420.4%
Simplified20.4%
Final simplification69.1%
(FPCore (x y) :precision binary64 (if (<= y 4.2e+138) (- 1.0 x) (* (* x x) (* x x))))
double code(double x, double y) {
double tmp;
if (y <= 4.2e+138) {
tmp = 1.0 - x;
} else {
tmp = (x * x) * (x * x);
}
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+138) then
tmp = 1.0d0 - x
else
tmp = (x * x) * (x * x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 4.2e+138) {
tmp = 1.0 - x;
} else {
tmp = (x * x) * (x * x);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4.2e+138: tmp = 1.0 - x else: tmp = (x * x) * (x * x) return tmp
function code(x, y) tmp = 0.0 if (y <= 4.2e+138) tmp = Float64(1.0 - x); else tmp = Float64(Float64(x * x) * Float64(x * x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4.2e+138) tmp = 1.0 - x; else tmp = (x * x) * (x * x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4.2e+138], N[(1.0 - x), $MachinePrecision], N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.2 \cdot 10^{+138}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot x\right) \cdot \left(x \cdot x\right)\\
\end{array}
\end{array}
if y < 4.20000000000000014e138Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6473.9%
Simplified73.9%
if 4.20000000000000014e138 < y Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f642.4%
Simplified2.4%
flip3--N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
--lowering--.f64N/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
distribute-rgt-outN/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f642.3%
Applied egg-rr2.3%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6421.5%
Simplified21.5%
Taylor expanded in x around inf
metadata-evalN/A
pow-plusN/A
unpow3N/A
unpow2N/A
associate-*l*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6420.4%
Simplified20.4%
(FPCore (x y) :precision binary64 (if (<= x 0.00185) 1.0 (- 0.0 x)))
double code(double x, double y) {
double tmp;
if (x <= 0.00185) {
tmp = 1.0;
} else {
tmp = 0.0 - x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 0.00185d0) then
tmp = 1.0d0
else
tmp = 0.0d0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 0.00185) {
tmp = 1.0;
} else {
tmp = 0.0 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.00185: tmp = 1.0 else: tmp = 0.0 - x return tmp
function code(x, y) tmp = 0.0 if (x <= 0.00185) tmp = 1.0; else tmp = Float64(0.0 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 0.00185) tmp = 1.0; else tmp = 0.0 - x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.00185], 1.0, N[(0.0 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.00185:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0 - x\\
\end{array}
\end{array}
if x < 0.0018500000000000001Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6461.0%
Simplified61.0%
Taylor expanded in x around 0
Simplified59.9%
if 0.0018500000000000001 < x Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6466.4%
Simplified66.4%
Taylor expanded in x around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6466.3%
Simplified66.3%
sub0-negN/A
neg-lowering-neg.f6466.3%
Applied egg-rr66.3%
Final simplification63.2%
(FPCore (x y) :precision binary64 (- 1.0 x))
double code(double x, double y) {
return 1.0 - x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 - x
end function
public static double code(double x, double y) {
return 1.0 - x;
}
def code(x, y): return 1.0 - x
function code(x, y) return Float64(1.0 - x) end
function tmp = code(x, y) tmp = 1.0 - x; end
code[x_, y_] := N[(1.0 - x), $MachinePrecision]
\begin{array}{l}
\\
1 - x
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6463.9%
Simplified63.9%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6463.9%
Simplified63.9%
Taylor expanded in x around 0
Simplified29.3%
herbie shell --seed 2024152
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, E"
:precision binary64
(+ (- 1.0 x) (* y (sqrt x))))