
(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
end function
public static double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
def code(x, y): return 1.0 - (((1.0 - x) * y) / (y + 1.0))
function code(x, y) return Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) end
function tmp = code(x, y) tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)); end
code[x_, y_] := N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
end function
public static double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
def code(x, y): return 1.0 - (((1.0 - x) * y) / (y + 1.0))
function code(x, y) return Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) end
function tmp = code(x, y) tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)); end
code[x_, y_] := N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\end{array}
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ 1.0 y)))
(t_1 (/ (+ 1.0 y) y))
(t_2 (+ 1.0 t_0))
(t_3 (/ x t_1))
(t_4 (/ (* (- 1.0 x) y) (+ 1.0 y)))
(t_5 (/ y t_1)))
(if (<= t_4 0.998)
(+
(+
(/ 1.0 (* t_2 (+ 1.0 (/ t_5 (+ 1.0 y)))))
(/
(/ y (* (/ t_1 t_0) (* (+ 1.0 y) t_1)))
(* t_2 (+ -1.0 (/ t_5 (- -1.0 y))))))
t_3)
(if (<= t_4 10000.0)
(+ t_3 (/ (+ 1.0 (/ (- -1.0 (/ (+ -1.0 (/ 1.0 y)) y)) y)) y))
(* x (+ (/ 1.0 x) (/ (* (- 1.0 x) (/ y (- -1.0 y))) x)))))))
double code(double x, double y) {
double t_0 = y / (1.0 + y);
double t_1 = (1.0 + y) / y;
double t_2 = 1.0 + t_0;
double t_3 = x / t_1;
double t_4 = ((1.0 - x) * y) / (1.0 + y);
double t_5 = y / t_1;
double tmp;
if (t_4 <= 0.998) {
tmp = ((1.0 / (t_2 * (1.0 + (t_5 / (1.0 + y))))) + ((y / ((t_1 / t_0) * ((1.0 + y) * t_1))) / (t_2 * (-1.0 + (t_5 / (-1.0 - y)))))) + t_3;
} else if (t_4 <= 10000.0) {
tmp = t_3 + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y);
} else {
tmp = x * ((1.0 / x) + (((1.0 - x) * (y / (-1.0 - y))) / 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = y / (1.0d0 + y)
t_1 = (1.0d0 + y) / y
t_2 = 1.0d0 + t_0
t_3 = x / t_1
t_4 = ((1.0d0 - x) * y) / (1.0d0 + y)
t_5 = y / t_1
if (t_4 <= 0.998d0) then
tmp = ((1.0d0 / (t_2 * (1.0d0 + (t_5 / (1.0d0 + y))))) + ((y / ((t_1 / t_0) * ((1.0d0 + y) * t_1))) / (t_2 * ((-1.0d0) + (t_5 / ((-1.0d0) - y)))))) + t_3
else if (t_4 <= 10000.0d0) then
tmp = t_3 + ((1.0d0 + (((-1.0d0) - (((-1.0d0) + (1.0d0 / y)) / y)) / y)) / y)
else
tmp = x * ((1.0d0 / x) + (((1.0d0 - x) * (y / ((-1.0d0) - y))) / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (1.0 + y);
double t_1 = (1.0 + y) / y;
double t_2 = 1.0 + t_0;
double t_3 = x / t_1;
double t_4 = ((1.0 - x) * y) / (1.0 + y);
double t_5 = y / t_1;
double tmp;
if (t_4 <= 0.998) {
tmp = ((1.0 / (t_2 * (1.0 + (t_5 / (1.0 + y))))) + ((y / ((t_1 / t_0) * ((1.0 + y) * t_1))) / (t_2 * (-1.0 + (t_5 / (-1.0 - y)))))) + t_3;
} else if (t_4 <= 10000.0) {
tmp = t_3 + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y);
} else {
tmp = x * ((1.0 / x) + (((1.0 - x) * (y / (-1.0 - y))) / x));
}
return tmp;
}
def code(x, y): t_0 = y / (1.0 + y) t_1 = (1.0 + y) / y t_2 = 1.0 + t_0 t_3 = x / t_1 t_4 = ((1.0 - x) * y) / (1.0 + y) t_5 = y / t_1 tmp = 0 if t_4 <= 0.998: tmp = ((1.0 / (t_2 * (1.0 + (t_5 / (1.0 + y))))) + ((y / ((t_1 / t_0) * ((1.0 + y) * t_1))) / (t_2 * (-1.0 + (t_5 / (-1.0 - y)))))) + t_3 elif t_4 <= 10000.0: tmp = t_3 + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y) else: tmp = x * ((1.0 / x) + (((1.0 - x) * (y / (-1.0 - y))) / x)) return tmp
function code(x, y) t_0 = Float64(y / Float64(1.0 + y)) t_1 = Float64(Float64(1.0 + y) / y) t_2 = Float64(1.0 + t_0) t_3 = Float64(x / t_1) t_4 = Float64(Float64(Float64(1.0 - x) * y) / Float64(1.0 + y)) t_5 = Float64(y / t_1) tmp = 0.0 if (t_4 <= 0.998) tmp = Float64(Float64(Float64(1.0 / Float64(t_2 * Float64(1.0 + Float64(t_5 / Float64(1.0 + y))))) + Float64(Float64(y / Float64(Float64(t_1 / t_0) * Float64(Float64(1.0 + y) * t_1))) / Float64(t_2 * Float64(-1.0 + Float64(t_5 / Float64(-1.0 - y)))))) + t_3); elseif (t_4 <= 10000.0) tmp = Float64(t_3 + Float64(Float64(1.0 + Float64(Float64(-1.0 - Float64(Float64(-1.0 + Float64(1.0 / y)) / y)) / y)) / y)); else tmp = Float64(x * Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 - x) * Float64(y / Float64(-1.0 - y))) / x))); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (1.0 + y); t_1 = (1.0 + y) / y; t_2 = 1.0 + t_0; t_3 = x / t_1; t_4 = ((1.0 - x) * y) / (1.0 + y); t_5 = y / t_1; tmp = 0.0; if (t_4 <= 0.998) tmp = ((1.0 / (t_2 * (1.0 + (t_5 / (1.0 + y))))) + ((y / ((t_1 / t_0) * ((1.0 + y) * t_1))) / (t_2 * (-1.0 + (t_5 / (-1.0 - y)))))) + t_3; elseif (t_4 <= 10000.0) tmp = t_3 + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y); else tmp = x * ((1.0 / x) + (((1.0 - x) * (y / (-1.0 - y))) / x)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + y), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(x / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(y / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$4, 0.998], N[(N[(N[(1.0 / N[(t$95$2 * N[(1.0 + N[(t$95$5 / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y / N[(N[(t$95$1 / t$95$0), $MachinePrecision] * N[(N[(1.0 + y), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * N[(-1.0 + N[(t$95$5 / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision], If[LessEqual[t$95$4, 10000.0], N[(t$95$3 + N[(N[(1.0 + N[(N[(-1.0 - N[(N[(-1.0 + N[(1.0 / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 - x), $MachinePrecision] * N[(y / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{1 + y}\\
t_1 := \frac{1 + y}{y}\\
t_2 := 1 + t\_0\\
t_3 := \frac{x}{t\_1}\\
t_4 := \frac{\left(1 - x\right) \cdot y}{1 + y}\\
t_5 := \frac{y}{t\_1}\\
\mathbf{if}\;t\_4 \leq 0.998:\\
\;\;\;\;\left(\frac{1}{t\_2 \cdot \left(1 + \frac{t\_5}{1 + y}\right)} + \frac{\frac{y}{\frac{t\_1}{t\_0} \cdot \left(\left(1 + y\right) \cdot t\_1\right)}}{t\_2 \cdot \left(-1 + \frac{t\_5}{-1 - y}\right)}\right) + t\_3\\
\mathbf{elif}\;t\_4 \leq 10000:\\
\;\;\;\;t\_3 + \frac{1 + \frac{-1 - \frac{-1 + \frac{1}{y}}{y}}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{1}{x} + \frac{\left(1 - x\right) \cdot \frac{y}{-1 - y}}{x}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 0.998Initial program 95.1%
sub-negN/A
+-commutativeN/A
distribute-neg-frac2N/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6499.9%
Applied egg-rr99.9%
+-commutativeN/A
*-commutativeN/A
frac-2negN/A
distribute-frac-neg2N/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
frac-2negN/A
cancel-sign-sub-invN/A
associate-/r/N/A
div-subN/A
associate--r-N/A
+-lowering-+.f64N/A
Applied egg-rr99.9%
flip--N/A
metadata-evalN/A
pow2N/A
+-commutativeN/A
pow2N/A
div-invN/A
*-lowering-*.f64N/A
Applied egg-rr99.9%
un-div-invN/A
flip--N/A
associate-/l/N/A
metadata-evalN/A
div-subN/A
--lowering--.f64N/A
Applied egg-rr99.9%
if 0.998 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 1e4Initial program 13.4%
sub-negN/A
+-commutativeN/A
distribute-neg-frac2N/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6413.5%
Applied egg-rr13.5%
+-commutativeN/A
*-commutativeN/A
frac-2negN/A
distribute-frac-neg2N/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
frac-2negN/A
cancel-sign-sub-invN/A
associate-/r/N/A
div-subN/A
associate--r-N/A
+-lowering-+.f64N/A
Applied egg-rr49.0%
flip--N/A
metadata-evalN/A
pow2N/A
+-commutativeN/A
pow2N/A
div-invN/A
*-lowering-*.f64N/A
Applied egg-rr49.3%
Taylor expanded in y around inf
Simplified99.8%
if 1e4 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 63.8%
clear-numN/A
div-invN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6463.7%
Applied egg-rr63.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.9%
Simplified99.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ 1.0 y)))
(t_1 (/ (* (- 1.0 x) y) (+ 1.0 y)))
(t_2 (/ x (/ (+ 1.0 y) y))))
(if (<= t_1 0.998)
(+ t_2 (* (+ 1.0 (/ t_0 (/ (- -1.0 y) y))) (/ 1.0 (+ 1.0 t_0))))
(if (<= t_1 10000.0)
(+ t_2 (/ (+ 1.0 (/ (- -1.0 (/ (+ -1.0 (/ 1.0 y)) y)) y)) y))
(* x (+ (/ 1.0 x) (/ (* (- 1.0 x) (/ y (- -1.0 y))) x)))))))
double code(double x, double y) {
double t_0 = y / (1.0 + y);
double t_1 = ((1.0 - x) * y) / (1.0 + y);
double t_2 = x / ((1.0 + y) / y);
double tmp;
if (t_1 <= 0.998) {
tmp = t_2 + ((1.0 + (t_0 / ((-1.0 - y) / y))) * (1.0 / (1.0 + t_0)));
} else if (t_1 <= 10000.0) {
tmp = t_2 + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y);
} else {
tmp = x * ((1.0 / x) + (((1.0 - x) * (y / (-1.0 - y))) / 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = y / (1.0d0 + y)
t_1 = ((1.0d0 - x) * y) / (1.0d0 + y)
t_2 = x / ((1.0d0 + y) / y)
if (t_1 <= 0.998d0) then
tmp = t_2 + ((1.0d0 + (t_0 / (((-1.0d0) - y) / y))) * (1.0d0 / (1.0d0 + t_0)))
else if (t_1 <= 10000.0d0) then
tmp = t_2 + ((1.0d0 + (((-1.0d0) - (((-1.0d0) + (1.0d0 / y)) / y)) / y)) / y)
else
tmp = x * ((1.0d0 / x) + (((1.0d0 - x) * (y / ((-1.0d0) - y))) / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (1.0 + y);
double t_1 = ((1.0 - x) * y) / (1.0 + y);
double t_2 = x / ((1.0 + y) / y);
double tmp;
if (t_1 <= 0.998) {
tmp = t_2 + ((1.0 + (t_0 / ((-1.0 - y) / y))) * (1.0 / (1.0 + t_0)));
} else if (t_1 <= 10000.0) {
tmp = t_2 + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y);
} else {
tmp = x * ((1.0 / x) + (((1.0 - x) * (y / (-1.0 - y))) / x));
}
return tmp;
}
def code(x, y): t_0 = y / (1.0 + y) t_1 = ((1.0 - x) * y) / (1.0 + y) t_2 = x / ((1.0 + y) / y) tmp = 0 if t_1 <= 0.998: tmp = t_2 + ((1.0 + (t_0 / ((-1.0 - y) / y))) * (1.0 / (1.0 + t_0))) elif t_1 <= 10000.0: tmp = t_2 + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y) else: tmp = x * ((1.0 / x) + (((1.0 - x) * (y / (-1.0 - y))) / x)) return tmp
function code(x, y) t_0 = Float64(y / Float64(1.0 + y)) t_1 = Float64(Float64(Float64(1.0 - x) * y) / Float64(1.0 + y)) t_2 = Float64(x / Float64(Float64(1.0 + y) / y)) tmp = 0.0 if (t_1 <= 0.998) tmp = Float64(t_2 + Float64(Float64(1.0 + Float64(t_0 / Float64(Float64(-1.0 - y) / y))) * Float64(1.0 / Float64(1.0 + t_0)))); elseif (t_1 <= 10000.0) tmp = Float64(t_2 + Float64(Float64(1.0 + Float64(Float64(-1.0 - Float64(Float64(-1.0 + Float64(1.0 / y)) / y)) / y)) / y)); else tmp = Float64(x * Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 - x) * Float64(y / Float64(-1.0 - y))) / x))); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (1.0 + y); t_1 = ((1.0 - x) * y) / (1.0 + y); t_2 = x / ((1.0 + y) / y); tmp = 0.0; if (t_1 <= 0.998) tmp = t_2 + ((1.0 + (t_0 / ((-1.0 - y) / y))) * (1.0 / (1.0 + t_0))); elseif (t_1 <= 10000.0) tmp = t_2 + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y); else tmp = x * ((1.0 / x) + (((1.0 - x) * (y / (-1.0 - y))) / x)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(N[(1.0 + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.998], N[(t$95$2 + N[(N[(1.0 + N[(t$95$0 / N[(N[(-1.0 - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 10000.0], N[(t$95$2 + N[(N[(1.0 + N[(N[(-1.0 - N[(N[(-1.0 + N[(1.0 / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 - x), $MachinePrecision] * N[(y / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{1 + y}\\
t_1 := \frac{\left(1 - x\right) \cdot y}{1 + y}\\
t_2 := \frac{x}{\frac{1 + y}{y}}\\
\mathbf{if}\;t\_1 \leq 0.998:\\
\;\;\;\;t\_2 + \left(1 + \frac{t\_0}{\frac{-1 - y}{y}}\right) \cdot \frac{1}{1 + t\_0}\\
\mathbf{elif}\;t\_1 \leq 10000:\\
\;\;\;\;t\_2 + \frac{1 + \frac{-1 - \frac{-1 + \frac{1}{y}}{y}}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{1}{x} + \frac{\left(1 - x\right) \cdot \frac{y}{-1 - y}}{x}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 0.998Initial program 95.1%
sub-negN/A
+-commutativeN/A
distribute-neg-frac2N/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6499.9%
Applied egg-rr99.9%
+-commutativeN/A
*-commutativeN/A
frac-2negN/A
distribute-frac-neg2N/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
frac-2negN/A
cancel-sign-sub-invN/A
associate-/r/N/A
div-subN/A
associate--r-N/A
+-lowering-+.f64N/A
Applied egg-rr99.9%
flip--N/A
metadata-evalN/A
pow2N/A
+-commutativeN/A
pow2N/A
div-invN/A
*-lowering-*.f64N/A
Applied egg-rr99.9%
if 0.998 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 1e4Initial program 13.4%
sub-negN/A
+-commutativeN/A
distribute-neg-frac2N/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6413.5%
Applied egg-rr13.5%
+-commutativeN/A
*-commutativeN/A
frac-2negN/A
distribute-frac-neg2N/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
frac-2negN/A
cancel-sign-sub-invN/A
associate-/r/N/A
div-subN/A
associate--r-N/A
+-lowering-+.f64N/A
Applied egg-rr49.0%
flip--N/A
metadata-evalN/A
pow2N/A
+-commutativeN/A
pow2N/A
div-invN/A
*-lowering-*.f64N/A
Applied egg-rr49.3%
Taylor expanded in y around inf
Simplified99.8%
if 1e4 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 63.8%
clear-numN/A
div-invN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6463.7%
Applied egg-rr63.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.9%
Simplified99.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (+ 1.0 y)))
(t_1 (/ (* (- 1.0 x) y) (+ 1.0 y)))
(t_2 (/ x (/ (+ 1.0 y) y))))
(if (<= t_1 0.998)
(+ t_2 (/ (+ 1.0 (/ t_0 (/ (- -1.0 y) y))) (+ 1.0 t_0)))
(if (<= t_1 10000.0)
(+ t_2 (/ (+ 1.0 (/ (- -1.0 (/ (+ -1.0 (/ 1.0 y)) y)) y)) y))
(* x (+ (/ 1.0 x) (/ (* (- 1.0 x) (/ y (- -1.0 y))) x)))))))
double code(double x, double y) {
double t_0 = y / (1.0 + y);
double t_1 = ((1.0 - x) * y) / (1.0 + y);
double t_2 = x / ((1.0 + y) / y);
double tmp;
if (t_1 <= 0.998) {
tmp = t_2 + ((1.0 + (t_0 / ((-1.0 - y) / y))) / (1.0 + t_0));
} else if (t_1 <= 10000.0) {
tmp = t_2 + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y);
} else {
tmp = x * ((1.0 / x) + (((1.0 - x) * (y / (-1.0 - y))) / 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = y / (1.0d0 + y)
t_1 = ((1.0d0 - x) * y) / (1.0d0 + y)
t_2 = x / ((1.0d0 + y) / y)
if (t_1 <= 0.998d0) then
tmp = t_2 + ((1.0d0 + (t_0 / (((-1.0d0) - y) / y))) / (1.0d0 + t_0))
else if (t_1 <= 10000.0d0) then
tmp = t_2 + ((1.0d0 + (((-1.0d0) - (((-1.0d0) + (1.0d0 / y)) / y)) / y)) / y)
else
tmp = x * ((1.0d0 / x) + (((1.0d0 - x) * (y / ((-1.0d0) - y))) / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (1.0 + y);
double t_1 = ((1.0 - x) * y) / (1.0 + y);
double t_2 = x / ((1.0 + y) / y);
double tmp;
if (t_1 <= 0.998) {
tmp = t_2 + ((1.0 + (t_0 / ((-1.0 - y) / y))) / (1.0 + t_0));
} else if (t_1 <= 10000.0) {
tmp = t_2 + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y);
} else {
tmp = x * ((1.0 / x) + (((1.0 - x) * (y / (-1.0 - y))) / x));
}
return tmp;
}
def code(x, y): t_0 = y / (1.0 + y) t_1 = ((1.0 - x) * y) / (1.0 + y) t_2 = x / ((1.0 + y) / y) tmp = 0 if t_1 <= 0.998: tmp = t_2 + ((1.0 + (t_0 / ((-1.0 - y) / y))) / (1.0 + t_0)) elif t_1 <= 10000.0: tmp = t_2 + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y) else: tmp = x * ((1.0 / x) + (((1.0 - x) * (y / (-1.0 - y))) / x)) return tmp
function code(x, y) t_0 = Float64(y / Float64(1.0 + y)) t_1 = Float64(Float64(Float64(1.0 - x) * y) / Float64(1.0 + y)) t_2 = Float64(x / Float64(Float64(1.0 + y) / y)) tmp = 0.0 if (t_1 <= 0.998) tmp = Float64(t_2 + Float64(Float64(1.0 + Float64(t_0 / Float64(Float64(-1.0 - y) / y))) / Float64(1.0 + t_0))); elseif (t_1 <= 10000.0) tmp = Float64(t_2 + Float64(Float64(1.0 + Float64(Float64(-1.0 - Float64(Float64(-1.0 + Float64(1.0 / y)) / y)) / y)) / y)); else tmp = Float64(x * Float64(Float64(1.0 / x) + Float64(Float64(Float64(1.0 - x) * Float64(y / Float64(-1.0 - y))) / x))); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (1.0 + y); t_1 = ((1.0 - x) * y) / (1.0 + y); t_2 = x / ((1.0 + y) / y); tmp = 0.0; if (t_1 <= 0.998) tmp = t_2 + ((1.0 + (t_0 / ((-1.0 - y) / y))) / (1.0 + t_0)); elseif (t_1 <= 10000.0) tmp = t_2 + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y); else tmp = x * ((1.0 / x) + (((1.0 - x) * (y / (-1.0 - y))) / x)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(N[(1.0 + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.998], N[(t$95$2 + N[(N[(1.0 + N[(t$95$0 / N[(N[(-1.0 - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 10000.0], N[(t$95$2 + N[(N[(1.0 + N[(N[(-1.0 - N[(N[(-1.0 + N[(1.0 / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(1.0 / x), $MachinePrecision] + N[(N[(N[(1.0 - x), $MachinePrecision] * N[(y / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{1 + y}\\
t_1 := \frac{\left(1 - x\right) \cdot y}{1 + y}\\
t_2 := \frac{x}{\frac{1 + y}{y}}\\
\mathbf{if}\;t\_1 \leq 0.998:\\
\;\;\;\;t\_2 + \frac{1 + \frac{t\_0}{\frac{-1 - y}{y}}}{1 + t\_0}\\
\mathbf{elif}\;t\_1 \leq 10000:\\
\;\;\;\;t\_2 + \frac{1 + \frac{-1 - \frac{-1 + \frac{1}{y}}{y}}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{1}{x} + \frac{\left(1 - x\right) \cdot \frac{y}{-1 - y}}{x}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 0.998Initial program 95.1%
sub-negN/A
+-commutativeN/A
distribute-neg-frac2N/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6499.9%
Applied egg-rr99.9%
+-commutativeN/A
*-commutativeN/A
frac-2negN/A
distribute-frac-neg2N/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
frac-2negN/A
cancel-sign-sub-invN/A
associate-/r/N/A
div-subN/A
associate--r-N/A
+-lowering-+.f64N/A
Applied egg-rr99.9%
sub-negN/A
flip-+N/A
metadata-evalN/A
sqr-negN/A
pow2N/A
+-commutativeN/A
pow2N/A
/-lowering-/.f64N/A
Applied egg-rr99.9%
if 0.998 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 1e4Initial program 13.4%
sub-negN/A
+-commutativeN/A
distribute-neg-frac2N/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6413.5%
Applied egg-rr13.5%
+-commutativeN/A
*-commutativeN/A
frac-2negN/A
distribute-frac-neg2N/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
frac-2negN/A
cancel-sign-sub-invN/A
associate-/r/N/A
div-subN/A
associate--r-N/A
+-lowering-+.f64N/A
Applied egg-rr49.0%
flip--N/A
metadata-evalN/A
pow2N/A
+-commutativeN/A
pow2N/A
div-invN/A
*-lowering-*.f64N/A
Applied egg-rr49.3%
Taylor expanded in y around inf
Simplified99.8%
if 1e4 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 63.8%
clear-numN/A
div-invN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6463.7%
Applied egg-rr63.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f6499.9%
Simplified99.9%
Taylor expanded in x around 0
/-lowering-/.f64N/A
Simplified99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(if (<= y -1700.0)
(+
(/ x (/ (+ 1.0 y) y))
(/ (+ 1.0 (/ (- -1.0 (/ (+ -1.0 (/ 1.0 y)) y)) y)) y))
(if (<= y 350000.0)
(+ 1.0 (/ (* (- 1.0 x) y) (- -1.0 y)))
(+ x (* (+ 1.0 (/ -1.0 y)) (/ (- 1.0 x) y))))))
double code(double x, double y) {
double tmp;
if (y <= -1700.0) {
tmp = (x / ((1.0 + y) / y)) + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y);
} else if (y <= 350000.0) {
tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y));
} else {
tmp = x + ((1.0 + (-1.0 / y)) * ((1.0 - x) / y));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1700.0d0)) then
tmp = (x / ((1.0d0 + y) / y)) + ((1.0d0 + (((-1.0d0) - (((-1.0d0) + (1.0d0 / y)) / y)) / y)) / y)
else if (y <= 350000.0d0) then
tmp = 1.0d0 + (((1.0d0 - x) * y) / ((-1.0d0) - y))
else
tmp = x + ((1.0d0 + ((-1.0d0) / y)) * ((1.0d0 - x) / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1700.0) {
tmp = (x / ((1.0 + y) / y)) + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y);
} else if (y <= 350000.0) {
tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y));
} else {
tmp = x + ((1.0 + (-1.0 / y)) * ((1.0 - x) / y));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1700.0: tmp = (x / ((1.0 + y) / y)) + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y) elif y <= 350000.0: tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y)) else: tmp = x + ((1.0 + (-1.0 / y)) * ((1.0 - x) / y)) return tmp
function code(x, y) tmp = 0.0 if (y <= -1700.0) tmp = Float64(Float64(x / Float64(Float64(1.0 + y) / y)) + Float64(Float64(1.0 + Float64(Float64(-1.0 - Float64(Float64(-1.0 + Float64(1.0 / y)) / y)) / y)) / y)); elseif (y <= 350000.0) tmp = Float64(1.0 + Float64(Float64(Float64(1.0 - x) * y) / Float64(-1.0 - y))); else tmp = Float64(x + Float64(Float64(1.0 + Float64(-1.0 / y)) * Float64(Float64(1.0 - x) / y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1700.0) tmp = (x / ((1.0 + y) / y)) + ((1.0 + ((-1.0 - ((-1.0 + (1.0 / y)) / y)) / y)) / y); elseif (y <= 350000.0) tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y)); else tmp = x + ((1.0 + (-1.0 / y)) * ((1.0 - x) / y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1700.0], N[(N[(x / N[(N[(1.0 + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(N[(-1.0 - N[(N[(-1.0 + N[(1.0 / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 350000.0], N[(1.0 + N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(1.0 + N[(-1.0 / y), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1700:\\
\;\;\;\;\frac{x}{\frac{1 + y}{y}} + \frac{1 + \frac{-1 - \frac{-1 + \frac{1}{y}}{y}}{y}}{y}\\
\mathbf{elif}\;y \leq 350000:\\
\;\;\;\;1 + \frac{\left(1 - x\right) \cdot y}{-1 - y}\\
\mathbf{else}:\\
\;\;\;\;x + \left(1 + \frac{-1}{y}\right) \cdot \frac{1 - x}{y}\\
\end{array}
\end{array}
if y < -1700Initial program 38.2%
sub-negN/A
+-commutativeN/A
distribute-neg-frac2N/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6461.1%
Applied egg-rr61.1%
+-commutativeN/A
*-commutativeN/A
frac-2negN/A
distribute-frac-neg2N/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
frac-2negN/A
cancel-sign-sub-invN/A
associate-/r/N/A
div-subN/A
associate--r-N/A
+-lowering-+.f64N/A
Applied egg-rr75.8%
flip--N/A
metadata-evalN/A
pow2N/A
+-commutativeN/A
pow2N/A
div-invN/A
*-lowering-*.f64N/A
Applied egg-rr76.1%
Taylor expanded in y around inf
Simplified99.9%
if -1700 < y < 3.5e5Initial program 99.8%
if 3.5e5 < y Initial program 35.0%
Taylor expanded in y around inf
Simplified99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (- 1.0 x) y)))
(if (<= y -14500000000.0)
(+ x (+ (/ (+ x -1.0) (* y y)) t_0))
(if (<= y 350000.0)
(+ 1.0 (/ (* (- 1.0 x) y) (- -1.0 y)))
(+ x (* (+ 1.0 (/ -1.0 y)) t_0))))))
double code(double x, double y) {
double t_0 = (1.0 - x) / y;
double tmp;
if (y <= -14500000000.0) {
tmp = x + (((x + -1.0) / (y * y)) + t_0);
} else if (y <= 350000.0) {
tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y));
} else {
tmp = x + ((1.0 + (-1.0 / y)) * 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) / y
if (y <= (-14500000000.0d0)) then
tmp = x + (((x + (-1.0d0)) / (y * y)) + t_0)
else if (y <= 350000.0d0) then
tmp = 1.0d0 + (((1.0d0 - x) * y) / ((-1.0d0) - y))
else
tmp = x + ((1.0d0 + ((-1.0d0) / y)) * t_0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (1.0 - x) / y;
double tmp;
if (y <= -14500000000.0) {
tmp = x + (((x + -1.0) / (y * y)) + t_0);
} else if (y <= 350000.0) {
tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y));
} else {
tmp = x + ((1.0 + (-1.0 / y)) * t_0);
}
return tmp;
}
def code(x, y): t_0 = (1.0 - x) / y tmp = 0 if y <= -14500000000.0: tmp = x + (((x + -1.0) / (y * y)) + t_0) elif y <= 350000.0: tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y)) else: tmp = x + ((1.0 + (-1.0 / y)) * t_0) return tmp
function code(x, y) t_0 = Float64(Float64(1.0 - x) / y) tmp = 0.0 if (y <= -14500000000.0) tmp = Float64(x + Float64(Float64(Float64(x + -1.0) / Float64(y * y)) + t_0)); elseif (y <= 350000.0) tmp = Float64(1.0 + Float64(Float64(Float64(1.0 - x) * y) / Float64(-1.0 - y))); else tmp = Float64(x + Float64(Float64(1.0 + Float64(-1.0 / y)) * t_0)); end return tmp end
function tmp_2 = code(x, y) t_0 = (1.0 - x) / y; tmp = 0.0; if (y <= -14500000000.0) tmp = x + (((x + -1.0) / (y * y)) + t_0); elseif (y <= 350000.0) tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y)); else tmp = x + ((1.0 + (-1.0 / y)) * t_0); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -14500000000.0], N[(x + N[(N[(N[(x + -1.0), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 350000.0], N[(1.0 + N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(1.0 + N[(-1.0 / y), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1 - x}{y}\\
\mathbf{if}\;y \leq -14500000000:\\
\;\;\;\;x + \left(\frac{x + -1}{y \cdot y} + t\_0\right)\\
\mathbf{elif}\;y \leq 350000:\\
\;\;\;\;1 + \frac{\left(1 - x\right) \cdot y}{-1 - y}\\
\mathbf{else}:\\
\;\;\;\;x + \left(1 + \frac{-1}{y}\right) \cdot t\_0\\
\end{array}
\end{array}
if y < -1.45e10Initial program 36.1%
sub-negN/A
+-commutativeN/A
distribute-neg-frac2N/A
*-commutativeN/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
--lowering--.f6459.8%
Applied egg-rr59.8%
+-commutativeN/A
*-commutativeN/A
frac-2negN/A
distribute-frac-neg2N/A
sub-negN/A
metadata-evalN/A
distribute-neg-inN/A
frac-2negN/A
cancel-sign-sub-invN/A
associate-/r/N/A
div-subN/A
associate--r-N/A
+-lowering-+.f64N/A
Applied egg-rr75.3%
Taylor expanded in y around inf
associate--l+N/A
+-lowering-+.f64N/A
associate--l+N/A
div-subN/A
+-lowering-+.f64N/A
associate-*r/N/A
+-commutativeN/A
distribute-lft-inN/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
metadata-evalN/A
metadata-evalN/A
sub-negN/A
/-lowering-/.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64100.0%
Simplified100.0%
if -1.45e10 < y < 3.5e5Initial program 99.7%
if 3.5e5 < y Initial program 35.0%
Taylor expanded in y around inf
Simplified99.9%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (* (+ 1.0 (/ -1.0 y)) (/ (- 1.0 x) y)))))
(if (<= y -14500000000.0)
t_0
(if (<= y 350000.0) (+ 1.0 (/ (* (- 1.0 x) y) (- -1.0 y))) t_0))))
double code(double x, double y) {
double t_0 = x + ((1.0 + (-1.0 / y)) * ((1.0 - x) / y));
double tmp;
if (y <= -14500000000.0) {
tmp = t_0;
} else if (y <= 350000.0) {
tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y));
} 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 = x + ((1.0d0 + ((-1.0d0) / y)) * ((1.0d0 - x) / y))
if (y <= (-14500000000.0d0)) then
tmp = t_0
else if (y <= 350000.0d0) then
tmp = 1.0d0 + (((1.0d0 - x) * y) / ((-1.0d0) - y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + ((1.0 + (-1.0 / y)) * ((1.0 - x) / y));
double tmp;
if (y <= -14500000000.0) {
tmp = t_0;
} else if (y <= 350000.0) {
tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x + ((1.0 + (-1.0 / y)) * ((1.0 - x) / y)) tmp = 0 if y <= -14500000000.0: tmp = t_0 elif y <= 350000.0: tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(Float64(1.0 + Float64(-1.0 / y)) * Float64(Float64(1.0 - x) / y))) tmp = 0.0 if (y <= -14500000000.0) tmp = t_0; elseif (y <= 350000.0) tmp = Float64(1.0 + Float64(Float64(Float64(1.0 - x) * y) / Float64(-1.0 - y))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x + ((1.0 + (-1.0 / y)) * ((1.0 - x) / y)); tmp = 0.0; if (y <= -14500000000.0) tmp = t_0; elseif (y <= 350000.0) tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(N[(1.0 + N[(-1.0 / y), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -14500000000.0], t$95$0, If[LessEqual[y, 350000.0], N[(1.0 + N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(1 + \frac{-1}{y}\right) \cdot \frac{1 - x}{y}\\
\mathbf{if}\;y \leq -14500000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 350000:\\
\;\;\;\;1 + \frac{\left(1 - x\right) \cdot y}{-1 - y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1.45e10 or 3.5e5 < y Initial program 35.5%
Taylor expanded in y around inf
Simplified99.9%
if -1.45e10 < y < 3.5e5Initial program 99.7%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (/ 1.0 y) (- x (/ x y)))))
(if (<= y -14500000000.0)
t_0
(if (<= y 165000000.0) (+ 1.0 (/ (* (- 1.0 x) y) (- -1.0 y))) t_0))))
double code(double x, double y) {
double t_0 = (1.0 / y) + (x - (x / y));
double tmp;
if (y <= -14500000000.0) {
tmp = t_0;
} else if (y <= 165000000.0) {
tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y));
} 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) + (x - (x / y))
if (y <= (-14500000000.0d0)) then
tmp = t_0
else if (y <= 165000000.0d0) then
tmp = 1.0d0 + (((1.0d0 - x) * y) / ((-1.0d0) - y))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (1.0 / y) + (x - (x / y));
double tmp;
if (y <= -14500000000.0) {
tmp = t_0;
} else if (y <= 165000000.0) {
tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (1.0 / y) + (x - (x / y)) tmp = 0 if y <= -14500000000.0: tmp = t_0 elif y <= 165000000.0: tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(1.0 / y) + Float64(x - Float64(x / y))) tmp = 0.0 if (y <= -14500000000.0) tmp = t_0; elseif (y <= 165000000.0) tmp = Float64(1.0 + Float64(Float64(Float64(1.0 - x) * y) / Float64(-1.0 - y))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (1.0 / y) + (x - (x / y)); tmp = 0.0; if (y <= -14500000000.0) tmp = t_0; elseif (y <= 165000000.0) tmp = 1.0 + (((1.0 - x) * y) / (-1.0 - y)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(1.0 / y), $MachinePrecision] + N[(x - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -14500000000.0], t$95$0, If[LessEqual[y, 165000000.0], N[(1.0 + N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{y} + \left(x - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -14500000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 165000000:\\
\;\;\;\;1 + \frac{\left(1 - x\right) \cdot y}{-1 - y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1.45e10 or 1.65e8 < y Initial program 35.5%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate--r-N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
--lowering--.f6499.2%
Simplified99.2%
+-commutativeN/A
div-subN/A
associate-+l-N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.2%
Applied egg-rr99.2%
if -1.45e10 < y < 1.65e8Initial program 99.7%
Final simplification99.5%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ (/ 1.0 y) (- x (/ x y))))) (if (<= y -1.0) t_0 (if (<= y 1.0) (+ 1.0 (* y (- x (* x y)))) t_0))))
double code(double x, double y) {
double t_0 = (1.0 / y) + (x - (x / y));
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 1.0) {
tmp = 1.0 + (y * (x - (x * y)));
} 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) + (x - (x / y))
if (y <= (-1.0d0)) then
tmp = t_0
else if (y <= 1.0d0) then
tmp = 1.0d0 + (y * (x - (x * y)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (1.0 / y) + (x - (x / y));
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 1.0) {
tmp = 1.0 + (y * (x - (x * y)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (1.0 / y) + (x - (x / y)) tmp = 0 if y <= -1.0: tmp = t_0 elif y <= 1.0: tmp = 1.0 + (y * (x - (x * y))) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(1.0 / y) + Float64(x - Float64(x / y))) tmp = 0.0 if (y <= -1.0) tmp = t_0; elseif (y <= 1.0) tmp = Float64(1.0 + Float64(y * Float64(x - Float64(x * y)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (1.0 / y) + (x - (x / y)); tmp = 0.0; if (y <= -1.0) tmp = t_0; elseif (y <= 1.0) tmp = 1.0 + (y * (x - (x * y))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(1.0 / y), $MachinePrecision] + N[(x - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, 1.0], N[(1.0 + N[(y * N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{y} + \left(x - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;1 + y \cdot \left(x - x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1 or 1 < y Initial program 37.4%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate--r-N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
--lowering--.f6497.4%
Simplified97.4%
+-commutativeN/A
div-subN/A
associate-+l-N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.5%
Applied egg-rr97.5%
if -1 < y < 1Initial program 100.0%
clear-numN/A
div-invN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6499.4%
Simplified99.4%
Taylor expanded in y around 0
+-lowering-+.f64N/A
distribute-lft-out--N/A
distribute-lft-out--N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5%
Simplified99.5%
Final simplification98.6%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ x (/ (- 1.0 x) y)))) (if (<= y -1.0) t_0 (if (<= y 1.0) (+ 1.0 (* y (- x (* x y)))) t_0))))
double code(double x, double y) {
double t_0 = x + ((1.0 - x) / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 1.0) {
tmp = 1.0 + (y * (x - (x * y)));
} 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 = x + ((1.0d0 - x) / y)
if (y <= (-1.0d0)) then
tmp = t_0
else if (y <= 1.0d0) then
tmp = 1.0d0 + (y * (x - (x * y)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + ((1.0 - x) / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 1.0) {
tmp = 1.0 + (y * (x - (x * y)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x + ((1.0 - x) / y) tmp = 0 if y <= -1.0: tmp = t_0 elif y <= 1.0: tmp = 1.0 + (y * (x - (x * y))) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(Float64(1.0 - x) / y)) tmp = 0.0 if (y <= -1.0) tmp = t_0; elseif (y <= 1.0) tmp = Float64(1.0 + Float64(y * Float64(x - Float64(x * y)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x + ((1.0 - x) / y); tmp = 0.0; if (y <= -1.0) tmp = t_0; elseif (y <= 1.0) tmp = 1.0 + (y * (x - (x * y))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, 1.0], N[(1.0 + N[(y * N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{1 - x}{y}\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;1 + y \cdot \left(x - x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1 or 1 < y Initial program 37.4%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate--r-N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
--lowering--.f6497.4%
Simplified97.4%
if -1 < y < 1Initial program 100.0%
clear-numN/A
div-invN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6499.4%
Simplified99.4%
Taylor expanded in y around 0
+-lowering-+.f64N/A
distribute-lft-out--N/A
distribute-lft-out--N/A
sub-negN/A
mul-1-negN/A
remove-double-negN/A
+-commutativeN/A
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.5%
Simplified99.5%
Final simplification98.6%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ x (/ (- 1.0 x) y)))) (if (<= y -1.0) t_0 (if (<= y 1.0) (+ 1.0 (* y (+ x -1.0))) t_0))))
double code(double x, double y) {
double t_0 = x + ((1.0 - x) / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 1.0) {
tmp = 1.0 + (y * (x + -1.0));
} 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 = x + ((1.0d0 - x) / y)
if (y <= (-1.0d0)) then
tmp = t_0
else if (y <= 1.0d0) then
tmp = 1.0d0 + (y * (x + (-1.0d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + ((1.0 - x) / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 1.0) {
tmp = 1.0 + (y * (x + -1.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x + ((1.0 - x) / y) tmp = 0 if y <= -1.0: tmp = t_0 elif y <= 1.0: tmp = 1.0 + (y * (x + -1.0)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(Float64(1.0 - x) / y)) tmp = 0.0 if (y <= -1.0) tmp = t_0; elseif (y <= 1.0) tmp = Float64(1.0 + Float64(y * Float64(x + -1.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x + ((1.0 - x) / y); tmp = 0.0; if (y <= -1.0) tmp = t_0; elseif (y <= 1.0) tmp = 1.0 + (y * (x + -1.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, 1.0], N[(1.0 + N[(y * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{1 - x}{y}\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;1 + y \cdot \left(x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1 or 1 < y Initial program 37.4%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate--r-N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
--lowering--.f6497.4%
Simplified97.4%
if -1 < y < 1Initial program 100.0%
Taylor expanded in y around 0
sub-negN/A
+-commutativeN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
--lowering--.f6499.4%
Simplified99.4%
Final simplification98.5%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ x (/ (- 1.0 x) y)))) (if (<= y -1.0) t_0 (if (<= y 1.2) (+ 1.0 (* x y)) t_0))))
double code(double x, double y) {
double t_0 = x + ((1.0 - x) / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 1.2) {
tmp = 1.0 + (x * y);
} 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 = x + ((1.0d0 - x) / y)
if (y <= (-1.0d0)) then
tmp = t_0
else if (y <= 1.2d0) then
tmp = 1.0d0 + (x * y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + ((1.0 - x) / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 1.2) {
tmp = 1.0 + (x * y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x + ((1.0 - x) / y) tmp = 0 if y <= -1.0: tmp = t_0 elif y <= 1.2: tmp = 1.0 + (x * y) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(Float64(1.0 - x) / y)) tmp = 0.0 if (y <= -1.0) tmp = t_0; elseif (y <= 1.2) tmp = Float64(1.0 + Float64(x * y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x + ((1.0 - x) / y); tmp = 0.0; if (y <= -1.0) tmp = t_0; elseif (y <= 1.2) tmp = 1.0 + (x * y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, 1.2], N[(1.0 + N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{1 - x}{y}\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1.2:\\
\;\;\;\;1 + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1 or 1.19999999999999996 < y Initial program 37.4%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate--r-N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
--lowering--.f6497.4%
Simplified97.4%
if -1 < y < 1.19999999999999996Initial program 100.0%
clear-numN/A
div-invN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6499.4%
Simplified99.4%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.4%
Simplified99.4%
Final simplification98.5%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ x (/ 1.0 y)))) (if (<= y -1.0) t_0 (if (<= y 1.0) (+ 1.0 (* x y)) t_0))))
double code(double x, double y) {
double t_0 = x + (1.0 / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 1.0) {
tmp = 1.0 + (x * y);
} 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 = x + (1.0d0 / y)
if (y <= (-1.0d0)) then
tmp = t_0
else if (y <= 1.0d0) then
tmp = 1.0d0 + (x * y)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (1.0 / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 1.0) {
tmp = 1.0 + (x * y);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x + (1.0 / y) tmp = 0 if y <= -1.0: tmp = t_0 elif y <= 1.0: tmp = 1.0 + (x * y) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(1.0 / y)) tmp = 0.0 if (y <= -1.0) tmp = t_0; elseif (y <= 1.0) tmp = Float64(1.0 + Float64(x * y)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x + (1.0 / y); tmp = 0.0; if (y <= -1.0) tmp = t_0; elseif (y <= 1.0) tmp = 1.0 + (x * y); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(1.0 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, 1.0], N[(1.0 + N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \frac{1}{y}\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;1 + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1 or 1 < y Initial program 37.4%
Taylor expanded in y around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate--r-N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
+-lowering-+.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
--lowering--.f6497.4%
Simplified97.4%
Taylor expanded in x around 0
/-lowering-/.f6496.7%
Simplified96.7%
if -1 < y < 1Initial program 100.0%
clear-numN/A
div-invN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6499.4%
Simplified99.4%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.4%
Simplified99.4%
Final simplification98.1%
(FPCore (x y) :precision binary64 (if (<= y -1.0) x (if (<= y 340.0) (+ 1.0 (* x y)) x)))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 340.0) {
tmp = 1.0 + (x * y);
} else {
tmp = 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.0d0)) then
tmp = x
else if (y <= 340.0d0) then
tmp = 1.0d0 + (x * y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 340.0) {
tmp = 1.0 + (x * y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= 340.0: tmp = 1.0 + (x * y) else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = x; elseif (y <= 340.0) tmp = Float64(1.0 + Float64(x * y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.0) tmp = x; elseif (y <= 340.0) tmp = 1.0 + (x * y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], x, If[LessEqual[y, 340.0], N[(1.0 + N[(x * y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 340:\\
\;\;\;\;1 + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 340 < y Initial program 36.4%
Taylor expanded in y around inf
Simplified71.1%
if -1 < y < 340Initial program 99.8%
clear-numN/A
div-invN/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6498.2%
Simplified98.2%
Taylor expanded in y around 0
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6498.2%
Simplified98.2%
Final simplification86.2%
(FPCore (x y) :precision binary64 (if (<= y -1.0) x (if (<= y 350.0) 1.0 x)))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 350.0) {
tmp = 1.0;
} else {
tmp = 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.0d0)) then
tmp = x
else if (y <= 350.0d0) then
tmp = 1.0d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 350.0) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= 350.0: tmp = 1.0 else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = x; elseif (y <= 350.0) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.0) tmp = x; elseif (y <= 350.0) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], x, If[LessEqual[y, 350.0], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 350:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 350 < y Initial program 36.4%
Taylor expanded in y around inf
Simplified71.1%
if -1 < y < 350Initial program 99.8%
Taylor expanded in y around 0
Simplified76.0%
(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 71.8%
Taylor expanded in y around 0
Simplified44.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (/ 1.0 y) (- (/ x y) x))))
(if (< y -3693.8482788297247)
t_0
(if (< y 6799310503.41891) (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))) t_0))))
double code(double x, double y) {
double t_0 = (1.0 / y) - ((x / y) - x);
double tmp;
if (y < -3693.8482788297247) {
tmp = t_0;
} else if (y < 6799310503.41891) {
tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0));
} 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) - ((x / y) - x)
if (y < (-3693.8482788297247d0)) then
tmp = t_0
else if (y < 6799310503.41891d0) then
tmp = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (1.0 / y) - ((x / y) - x);
double tmp;
if (y < -3693.8482788297247) {
tmp = t_0;
} else if (y < 6799310503.41891) {
tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (1.0 / y) - ((x / y) - x) tmp = 0 if y < -3693.8482788297247: tmp = t_0 elif y < 6799310503.41891: tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(1.0 / y) - Float64(Float64(x / y) - x)) tmp = 0.0 if (y < -3693.8482788297247) tmp = t_0; elseif (y < 6799310503.41891) tmp = Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (1.0 / y) - ((x / y) - x); tmp = 0.0; if (y < -3693.8482788297247) tmp = t_0; elseif (y < 6799310503.41891) tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(1.0 / y), $MachinePrecision] - N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -3693.8482788297247], t$95$0, If[Less[y, 6799310503.41891], N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{y} - \left(\frac{x}{y} - x\right)\\
\mathbf{if}\;y < -3693.8482788297247:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y < 6799310503.41891:\\
\;\;\;\;1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
herbie shell --seed 2024191
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
:alt
(! :herbie-platform default (if (< y -36938482788297247/10000000000000) (- (/ 1 y) (- (/ x y) x)) (if (< y 679931050341891/100000) (- 1 (/ (* (- 1 x) y) (+ y 1))) (- (/ 1 y) (- (/ x y) x)))))
(- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))