
(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 10 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.8%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ 1.0 (* y (sqrt x))))) (if (<= y -4.3e+24) t_0 (if (<= y 1.25e+47) (- 1.0 x) t_0))))
double code(double x, double y) {
double t_0 = 1.0 + (y * sqrt(x));
double tmp;
if (y <= -4.3e+24) {
tmp = t_0;
} else if (y <= 1.25e+47) {
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 <= (-4.3d+24)) then
tmp = t_0
else if (y <= 1.25d+47) 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 <= -4.3e+24) {
tmp = t_0;
} else if (y <= 1.25e+47) {
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 <= -4.3e+24: tmp = t_0 elif y <= 1.25e+47: 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 <= -4.3e+24) tmp = t_0; elseif (y <= 1.25e+47) 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 <= -4.3e+24) tmp = t_0; elseif (y <= 1.25e+47) 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, -4.3e+24], t$95$0, If[LessEqual[y, 1.25e+47], 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 -4.3 \cdot 10^{+24}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+47}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -4.29999999999999987e24 or 1.25000000000000005e47 < y Initial program 99.7%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6492.2%
Simplified92.2%
if -4.29999999999999987e24 < y < 1.25000000000000005e47Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6498.7%
Simplified98.7%
Final simplification95.7%
(FPCore (x y) :precision binary64 (let* ((t_0 (* y (sqrt x)))) (if (<= y -5.2e+87) t_0 (if (<= y 5.4e+78) (- 1.0 x) t_0))))
double code(double x, double y) {
double t_0 = y * sqrt(x);
double tmp;
if (y <= -5.2e+87) {
tmp = t_0;
} else if (y <= 5.4e+78) {
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 <= (-5.2d+87)) then
tmp = t_0
else if (y <= 5.4d+78) 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 <= -5.2e+87) {
tmp = t_0;
} else if (y <= 5.4e+78) {
tmp = 1.0 - x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = y * math.sqrt(x) tmp = 0 if y <= -5.2e+87: tmp = t_0 elif y <= 5.4e+78: 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 <= -5.2e+87) tmp = t_0; elseif (y <= 5.4e+78) 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 <= -5.2e+87) tmp = t_0; elseif (y <= 5.4e+78) 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, -5.2e+87], t$95$0, If[LessEqual[y, 5.4e+78], N[(1.0 - x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \sqrt{x}\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+87}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+78}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -5.19999999999999997e87 or 5.40000000000000009e78 < y Initial program 99.6%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f6491.3%
Simplified91.3%
if -5.19999999999999997e87 < y < 5.40000000000000009e78Initial program 100.0%
Taylor expanded in y around 0
--lowering--.f6493.0%
Simplified93.0%
Final simplification92.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (* x (* x x)))))
(if (<= y -1.2e+153)
(* t_0 (+ 1.0 (* x (+ (* x x) -1.0))))
(if (<= y 6.2e+130) (- 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 <= -1.2e+153) {
tmp = t_0 * (1.0 + (x * ((x * x) + -1.0)));
} else if (y <= 6.2e+130) {
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 <= (-1.2d+153)) then
tmp = t_0 * (1.0d0 + (x * ((x * x) + (-1.0d0))))
else if (y <= 6.2d+130) 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 <= -1.2e+153) {
tmp = t_0 * (1.0 + (x * ((x * x) + -1.0)));
} else if (y <= 6.2e+130) {
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 <= -1.2e+153: tmp = t_0 * (1.0 + (x * ((x * x) + -1.0))) elif y <= 6.2e+130: 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 <= -1.2e+153) tmp = Float64(t_0 * Float64(1.0 + Float64(x * Float64(Float64(x * x) + -1.0)))); elseif (y <= 6.2e+130) 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 <= -1.2e+153) tmp = t_0 * (1.0 + (x * ((x * x) + -1.0))); elseif (y <= 6.2e+130) 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, -1.2e+153], N[(t$95$0 * N[(1.0 + N[(x * N[(N[(x * x), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e+130], 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 -1.2 \cdot 10^{+153}:\\
\;\;\;\;t\_0 \cdot \left(1 + x \cdot \left(x \cdot x + -1\right)\right)\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+130}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;\left(1 - x\right) \cdot t\_0\\
\end{array}
\end{array}
if y < -1.19999999999999996e153Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f643.5%
Simplified3.5%
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
+-lowering-+.f645.8%
Applied egg-rr5.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6422.3%
Simplified22.3%
if -1.19999999999999996e153 < y < 6.1999999999999999e130Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6481.2%
Simplified81.2%
if 6.1999999999999999e130 < y Initial program 99.6%
Taylor expanded in y around 0
--lowering--.f643.7%
Simplified3.7%
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
+-lowering-+.f643.6%
Applied egg-rr3.6%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6429.3%
Simplified29.3%
Final simplification67.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (* x x))) (t_1 (- 1.0 t_0)))
(if (<= y -1.6e+152)
(* t_1 (+ 1.0 t_0))
(if (<= y 4.6e+128) (- 1.0 x) (* (- 1.0 x) t_1)))))
double code(double x, double y) {
double t_0 = x * (x * x);
double t_1 = 1.0 - t_0;
double tmp;
if (y <= -1.6e+152) {
tmp = t_1 * (1.0 + t_0);
} else if (y <= 4.6e+128) {
tmp = 1.0 - x;
} else {
tmp = (1.0 - x) * 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 = x * (x * x)
t_1 = 1.0d0 - t_0
if (y <= (-1.6d+152)) then
tmp = t_1 * (1.0d0 + t_0)
else if (y <= 4.6d+128) then
tmp = 1.0d0 - x
else
tmp = (1.0d0 - x) * t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x * (x * x);
double t_1 = 1.0 - t_0;
double tmp;
if (y <= -1.6e+152) {
tmp = t_1 * (1.0 + t_0);
} else if (y <= 4.6e+128) {
tmp = 1.0 - x;
} else {
tmp = (1.0 - x) * t_1;
}
return tmp;
}
def code(x, y): t_0 = x * (x * x) t_1 = 1.0 - t_0 tmp = 0 if y <= -1.6e+152: tmp = t_1 * (1.0 + t_0) elif y <= 4.6e+128: tmp = 1.0 - x else: tmp = (1.0 - x) * t_1 return tmp
function code(x, y) t_0 = Float64(x * Float64(x * x)) t_1 = Float64(1.0 - t_0) tmp = 0.0 if (y <= -1.6e+152) tmp = Float64(t_1 * Float64(1.0 + t_0)); elseif (y <= 4.6e+128) tmp = Float64(1.0 - x); else tmp = Float64(Float64(1.0 - x) * t_1); end return tmp end
function tmp_2 = code(x, y) t_0 = x * (x * x); t_1 = 1.0 - t_0; tmp = 0.0; if (y <= -1.6e+152) tmp = t_1 * (1.0 + t_0); elseif (y <= 4.6e+128) tmp = 1.0 - x; else tmp = (1.0 - x) * t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - t$95$0), $MachinePrecision]}, If[LessEqual[y, -1.6e+152], N[(t$95$1 * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e+128], N[(1.0 - x), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot x\right)\\
t_1 := 1 - t\_0\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{+152}:\\
\;\;\;\;t\_1 \cdot \left(1 + t\_0\right)\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+128}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;\left(1 - x\right) \cdot t\_1\\
\end{array}
\end{array}
if y < -1.60000000000000003e152Initial program 99.7%
Taylor expanded in y around 0
--lowering--.f643.5%
Simplified3.5%
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
+-lowering-+.f645.8%
Applied egg-rr5.8%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6422.3%
Simplified22.3%
Taylor expanded in x around inf
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6422.3%
Simplified22.3%
if -1.60000000000000003e152 < y < 4.59999999999999996e128Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6481.2%
Simplified81.2%
if 4.59999999999999996e128 < y Initial program 99.6%
Taylor expanded in y around 0
--lowering--.f643.7%
Simplified3.7%
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
+-lowering-+.f643.6%
Applied egg-rr3.6%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6429.3%
Simplified29.3%
Final simplification67.5%
(FPCore (x y) :precision binary64 (if (<= y 9.2e+129) (- 1.0 x) (* (- 1.0 x) (- 1.0 (* x (* x x))))))
double code(double x, double y) {
double tmp;
if (y <= 9.2e+129) {
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 <= 9.2d+129) 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 <= 9.2e+129) {
tmp = 1.0 - x;
} else {
tmp = (1.0 - x) * (1.0 - (x * (x * x)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 9.2e+129: 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 <= 9.2e+129) 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 <= 9.2e+129) 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, 9.2e+129], 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 9.2 \cdot 10^{+129}:\\
\;\;\;\;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 < 9.19999999999999961e129Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6471.9%
Simplified71.9%
if 9.19999999999999961e129 < y Initial program 99.6%
Taylor expanded in y around 0
--lowering--.f643.7%
Simplified3.7%
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
+-lowering-+.f643.6%
Applied egg-rr3.6%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6429.3%
Simplified29.3%
Final simplification65.6%
(FPCore (x y) :precision binary64 (if (<= y 9.5e+134) (- 1.0 x) (* x (* x (* x x)))))
double code(double x, double y) {
double tmp;
if (y <= 9.5e+134) {
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 <= 9.5d+134) 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 <= 9.5e+134) {
tmp = 1.0 - x;
} else {
tmp = x * (x * (x * x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 9.5e+134: tmp = 1.0 - x else: tmp = x * (x * (x * x)) return tmp
function code(x, y) tmp = 0.0 if (y <= 9.5e+134) tmp = Float64(1.0 - x); else tmp = Float64(x * Float64(x * Float64(x * x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 9.5e+134) tmp = 1.0 - x; else tmp = x * (x * (x * x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 9.5e+134], N[(1.0 - x), $MachinePrecision], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.5 \cdot 10^{+134}:\\
\;\;\;\;1 - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\end{array}
\end{array}
if y < 9.5000000000000004e134Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6471.8%
Simplified71.8%
if 9.5000000000000004e134 < y Initial program 99.6%
Taylor expanded in y around 0
--lowering--.f642.6%
Simplified2.6%
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
+-lowering-+.f642.5%
Applied egg-rr2.5%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6428.8%
Simplified28.8%
Taylor expanded in x around inf
metadata-evalN/A
pow-plusN/A
*-commutativeN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.6%
Simplified27.6%
(FPCore (x y) :precision binary64 (if (<= x 115000.0) 1.0 (- 0.0 x)))
double code(double x, double y) {
double tmp;
if (x <= 115000.0) {
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 <= 115000.0d0) 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 <= 115000.0) {
tmp = 1.0;
} else {
tmp = 0.0 - x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 115000.0: tmp = 1.0 else: tmp = 0.0 - x return tmp
function code(x, y) tmp = 0.0 if (x <= 115000.0) tmp = 1.0; else tmp = Float64(0.0 - x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 115000.0) tmp = 1.0; else tmp = 0.0 - x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 115000.0], 1.0, N[(0.0 - x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 115000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;0 - x\\
\end{array}
\end{array}
if x < 115000Initial program 99.9%
Taylor expanded in y around 0
--lowering--.f6461.9%
Simplified61.9%
Taylor expanded in x around 0
Simplified60.1%
if 115000 < x Initial program 99.8%
Taylor expanded in y around 0
--lowering--.f6461.8%
Simplified61.8%
Taylor expanded in x around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6461.0%
Simplified61.0%
sub0-negN/A
neg-lowering-neg.f6461.0%
Applied egg-rr61.0%
Final simplification60.5%
(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.8%
Taylor expanded in y around 0
--lowering--.f6461.8%
Simplified61.8%
(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.8%
Taylor expanded in y around 0
--lowering--.f6461.8%
Simplified61.8%
Taylor expanded in x around 0
Simplified30.6%
herbie shell --seed 2024138
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, E"
:precision binary64
(+ (- 1.0 x) (* y (sqrt x))))