
(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 9 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 (+ (- 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}
Initial program 99.9%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ 1.0 (* y (sqrt x))))) (if (<= y -6.8e+46) t_0 (if (<= y 2.3e+49) (- 1.0 x) t_0))))
double code(double x, double y) {
double t_0 = 1.0 + (y * sqrt(x));
double tmp;
if (y <= -6.8e+46) {
tmp = t_0;
} else if (y <= 2.3e+49) {
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 + (y * sqrt(x))
if (y <= (-6.8d+46)) then
tmp = t_0
else if (y <= 2.3d+49) 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 + (y * Math.sqrt(x));
double tmp;
if (y <= -6.8e+46) {
tmp = t_0;
} else if (y <= 2.3e+49) {
tmp = 1.0 - x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 1.0 + (y * math.sqrt(x)) tmp = 0 if y <= -6.8e+46: tmp = t_0 elif y <= 2.3e+49: tmp = 1.0 - x else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(1.0 + Float64(y * sqrt(x))) tmp = 0.0 if (y <= -6.8e+46) tmp = t_0; elseif (y <= 2.3e+49) tmp = Float64(1.0 - x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 + (y * sqrt(x)); tmp = 0.0; if (y <= -6.8e+46) tmp = t_0; elseif (y <= 2.3e+49) tmp = 1.0 - x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 + N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.8e+46], t$95$0, If[LessEqual[y, 2.3e+49], N[(1.0 - x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + y \cdot \sqrt{x}\\
\mathbf{if}\;y \leq -6.8 \cdot 10^{+46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+49}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -6.7999999999999996e46 or 2.30000000000000002e49 < y Initial program 99.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6494.0%
Simplified94.0%
if -6.7999999999999996e46 < y < 2.30000000000000002e49Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6498.6%
Simplified98.6%
Final simplification96.7%
(FPCore (x y) :precision binary64 (let* ((t_0 (* y (sqrt x)))) (if (<= y -2.8e+48) t_0 (if (<= y 5.4e+76) (- 1.0 x) t_0))))
double code(double x, double y) {
double t_0 = y * sqrt(x);
double tmp;
if (y <= -2.8e+48) {
tmp = t_0;
} else if (y <= 5.4e+76) {
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 = y * sqrt(x)
if (y <= (-2.8d+48)) then
tmp = t_0
else if (y <= 5.4d+76) 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 = y * Math.sqrt(x);
double tmp;
if (y <= -2.8e+48) {
tmp = t_0;
} else if (y <= 5.4e+76) {
tmp = 1.0 - x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = y * math.sqrt(x) tmp = 0 if y <= -2.8e+48: tmp = t_0 elif y <= 5.4e+76: tmp = 1.0 - x else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(y * sqrt(x)) tmp = 0.0 if (y <= -2.8e+48) tmp = t_0; elseif (y <= 5.4e+76) tmp = Float64(1.0 - x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = y * sqrt(x); tmp = 0.0; if (y <= -2.8e+48) tmp = t_0; elseif (y <= 5.4e+76) tmp = 1.0 - x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.8e+48], t$95$0, If[LessEqual[y, 5.4e+76], N[(1.0 - x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \sqrt{x}\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{+48}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+76}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -2.80000000000000012e48 or 5.3999999999999998e76 < y Initial program 99.7%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6490.3%
Simplified90.3%
if -2.80000000000000012e48 < y < 5.3999999999999998e76Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6496.9%
Simplified96.9%
Final simplification94.3%
(FPCore (x y) :precision binary64 (let* ((t_0 (* y (sqrt x)))) (if (<= x 0.0042) (+ 1.0 t_0) (- t_0 x))))
double code(double x, double y) {
double t_0 = y * sqrt(x);
double tmp;
if (x <= 0.0042) {
tmp = 1.0 + t_0;
} else {
tmp = t_0 - x;
}
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 = y * sqrt(x)
if (x <= 0.0042d0) then
tmp = 1.0d0 + t_0
else
tmp = t_0 - x
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * Math.sqrt(x);
double tmp;
if (x <= 0.0042) {
tmp = 1.0 + t_0;
} else {
tmp = t_0 - x;
}
return tmp;
}
def code(x, y): t_0 = y * math.sqrt(x) tmp = 0 if x <= 0.0042: tmp = 1.0 + t_0 else: tmp = t_0 - x return tmp
function code(x, y) t_0 = Float64(y * sqrt(x)) tmp = 0.0 if (x <= 0.0042) tmp = Float64(1.0 + t_0); else tmp = Float64(t_0 - x); end return tmp end
function tmp_2 = code(x, y) t_0 = y * sqrt(x); tmp = 0.0; if (x <= 0.0042) tmp = 1.0 + t_0; else tmp = t_0 - x; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.0042], N[(1.0 + t$95$0), $MachinePrecision], N[(t$95$0 - x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \sqrt{x}\\
\mathbf{if}\;x \leq 0.0042:\\
\;\;\;\;1 + t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_0 - x\\
\end{array}
\end{array}
if x < 0.00419999999999999974Initial program 99.9%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6498.9%
Simplified98.9%
if 0.00419999999999999974 < x Initial program 99.9%
*-commutativeN/A
pow1/2N/A
sqr-powN/A
associate-*l*N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
metadata-evalN/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6499.3%
Simplified99.3%
Taylor expanded in x around 0
+-commutativeN/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6499.5%
Simplified99.5%
Final simplification99.2%
(FPCore (x y) :precision binary64 (if (<= y -3.15e+91) (+ 1.0 (* x (- -1.0 (* y y)))) (if (<= y 1.8e+93) (- 1.0 x) (- 1.0 (- x (* y y))))))
double code(double x, double y) {
double tmp;
if (y <= -3.15e+91) {
tmp = 1.0 + (x * (-1.0 - (y * y)));
} else if (y <= 1.8e+93) {
tmp = 1.0 - x;
} else {
tmp = 1.0 - (x - (y * 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.15d+91)) then
tmp = 1.0d0 + (x * ((-1.0d0) - (y * y)))
else if (y <= 1.8d+93) then
tmp = 1.0d0 - x
else
tmp = 1.0d0 - (x - (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -3.15e+91) {
tmp = 1.0 + (x * (-1.0 - (y * y)));
} else if (y <= 1.8e+93) {
tmp = 1.0 - x;
} else {
tmp = 1.0 - (x - (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -3.15e+91: tmp = 1.0 + (x * (-1.0 - (y * y))) elif y <= 1.8e+93: tmp = 1.0 - x else: tmp = 1.0 - (x - (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= -3.15e+91) tmp = Float64(1.0 + Float64(x * Float64(-1.0 - Float64(y * y)))); elseif (y <= 1.8e+93) tmp = Float64(1.0 - x); else tmp = Float64(1.0 - Float64(x - Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -3.15e+91) tmp = 1.0 + (x * (-1.0 - (y * y))); elseif (y <= 1.8e+93) tmp = 1.0 - x; else tmp = 1.0 - (x - (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -3.15e+91], N[(1.0 + N[(x * N[(-1.0 - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e+93], N[(1.0 - x), $MachinePrecision], N[(1.0 - N[(x - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.15 \cdot 10^{+91}:\\
\;\;\;\;1 + x \cdot \left(-1 - y \cdot y\right)\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+93}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;1 - \left(x - y \cdot y\right)\\
\end{array}
\end{array}
if y < -3.15e91Initial program 99.7%
+-commutativeN/A
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
swap-sqrN/A
rem-square-sqrtN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6435.5%
Applied egg-rr35.5%
Taylor expanded in y around 0
sub-negN/A
metadata-evalN/A
+-lowering-+.f645.2%
Simplified5.2%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-inN/A
metadata-evalN/A
metadata-evalN/A
associate-+r+N/A
metadata-evalN/A
metadata-evalN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6414.5%
Simplified14.5%
if -3.15e91 < y < 1.8e93Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6491.8%
Simplified91.8%
if 1.8e93 < y Initial program 99.7%
+-commutativeN/A
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
swap-sqrN/A
rem-square-sqrtN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6426.0%
Applied egg-rr26.0%
Taylor expanded in y around 0
sub-negN/A
metadata-evalN/A
+-lowering-+.f648.6%
Simplified8.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lft-identityN/A
metadata-evalN/A
cancel-sign-sub-invN/A
associate-*r/N/A
div-subN/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6424.1%
Simplified24.1%
Taylor expanded in x around 0
mul-1-negN/A
associate-+r+N/A
sub-negN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6424.2%
Simplified24.2%
(FPCore (x y) :precision binary64 (if (<= y 1.8e+93) (- 1.0 x) (- 1.0 (- x (* y y)))))
double code(double x, double y) {
double tmp;
if (y <= 1.8e+93) {
tmp = 1.0 - x;
} else {
tmp = 1.0 - (x - (y * 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.8d+93) then
tmp = 1.0d0 - x
else
tmp = 1.0d0 - (x - (y * y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 1.8e+93) {
tmp = 1.0 - x;
} else {
tmp = 1.0 - (x - (y * y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 1.8e+93: tmp = 1.0 - x else: tmp = 1.0 - (x - (y * y)) return tmp
function code(x, y) tmp = 0.0 if (y <= 1.8e+93) tmp = Float64(1.0 - x); else tmp = Float64(1.0 - Float64(x - Float64(y * y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 1.8e+93) tmp = 1.0 - x; else tmp = 1.0 - (x - (y * y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 1.8e+93], N[(1.0 - x), $MachinePrecision], N[(1.0 - N[(x - N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{+93}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;1 - \left(x - y \cdot y\right)\\
\end{array}
\end{array}
if y < 1.8e93Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6474.0%
Simplified74.0%
if 1.8e93 < y Initial program 99.7%
+-commutativeN/A
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
swap-sqrN/A
rem-square-sqrtN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6426.0%
Applied egg-rr26.0%
Taylor expanded in y around 0
sub-negN/A
metadata-evalN/A
+-lowering-+.f648.6%
Simplified8.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lft-identityN/A
metadata-evalN/A
cancel-sign-sub-invN/A
associate-*r/N/A
div-subN/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6424.1%
Simplified24.1%
Taylor expanded in x around 0
mul-1-negN/A
associate-+r+N/A
sub-negN/A
associate-+l-N/A
--lowering--.f64N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6424.2%
Simplified24.2%
(FPCore (x y) :precision binary64 (if (<= y 8e+131) (- 1.0 x) (* y y)))
double code(double x, double y) {
double tmp;
if (y <= 8e+131) {
tmp = 1.0 - x;
} else {
tmp = y * y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 8d+131) then
tmp = 1.0d0 - x
else
tmp = y * y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 8e+131) {
tmp = 1.0 - x;
} else {
tmp = y * y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 8e+131: tmp = 1.0 - x else: tmp = y * y return tmp
function code(x, y) tmp = 0.0 if (y <= 8e+131) tmp = Float64(1.0 - x); else tmp = Float64(y * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 8e+131) tmp = 1.0 - x; else tmp = y * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 8e+131], N[(1.0 - x), $MachinePrecision], N[(y * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8 \cdot 10^{+131}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot y\\
\end{array}
\end{array}
if y < 7.9999999999999993e131Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6470.9%
Simplified70.9%
if 7.9999999999999993e131 < y Initial program 99.8%
+-commutativeN/A
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
swap-sqrN/A
rem-square-sqrtN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
--lowering--.f6412.0%
Applied egg-rr12.0%
Taylor expanded in y around 0
sub-negN/A
metadata-evalN/A
+-lowering-+.f6410.3%
Simplified10.3%
Taylor expanded in x around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lft-identityN/A
metadata-evalN/A
cancel-sign-sub-invN/A
associate-*r/N/A
div-subN/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6427.0%
Simplified27.0%
Taylor expanded in y around inf
unpow2N/A
*-lowering-*.f6427.0%
Simplified27.0%
(FPCore (x y) :precision binary64 (if (<= x 0.0042) 1.0 (- 0.0 x)))
double code(double x, double y) {
double tmp;
if (x <= 0.0042) {
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.0042d0) 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.0042) {
tmp = 1.0;
} else {
tmp = 0.0 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 0.0042: tmp = 1.0 else: tmp = 0.0 - x return tmp
function code(x, y) tmp = 0.0 if (x <= 0.0042) 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.0042) tmp = 1.0; else tmp = 0.0 - x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 0.0042], 1.0, N[(0.0 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0042:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0 - x\\
\end{array}
\end{array}
if x < 0.00419999999999999974Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6459.3%
Simplified59.3%
Taylor expanded in x around 0
Simplified58.4%
if 0.00419999999999999974 < x Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6463.2%
Simplified63.2%
Taylor expanded in x around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6462.7%
Simplified62.7%
sub0-negN/A
neg-lowering-neg.f6462.7%
Applied egg-rr62.7%
Final simplification60.7%
(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--.f6461.4%
Simplified61.4%
Taylor expanded in x around 0
Simplified28.4%
herbie shell --seed 2024158
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, E"
:precision binary64
(+ (- 1.0 x) (* y (sqrt x))))