
(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 11 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 x)) (+ 1.0 y))))
(if (<= t_0 0.2)
(fma (- 1.0 x) (/ y (- -1.0 y)) 1.0)
(if (<= t_0 500000000000.0)
(- x (/ (+ (+ x -1.0) (/ (- (- 1.0 x) (/ (- 1.0 x) y)) y)) y))
(+ 1.0 (* x (/ y (+ 1.0 y))))))))
double code(double x, double y) {
double t_0 = (y * (1.0 - x)) / (1.0 + y);
double tmp;
if (t_0 <= 0.2) {
tmp = fma((1.0 - x), (y / (-1.0 - y)), 1.0);
} else if (t_0 <= 500000000000.0) {
tmp = x - (((x + -1.0) + (((1.0 - x) - ((1.0 - x) / y)) / y)) / y);
} else {
tmp = 1.0 + (x * (y / (1.0 + y)));
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(y * Float64(1.0 - x)) / Float64(1.0 + y)) tmp = 0.0 if (t_0 <= 0.2) tmp = fma(Float64(1.0 - x), Float64(y / Float64(-1.0 - y)), 1.0); elseif (t_0 <= 500000000000.0) tmp = Float64(x - Float64(Float64(Float64(x + -1.0) + Float64(Float64(Float64(1.0 - x) - Float64(Float64(1.0 - x) / y)) / y)) / y)); else tmp = Float64(1.0 + Float64(x * Float64(y / Float64(1.0 + y)))); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.2], N[(N[(1.0 - x), $MachinePrecision] * N[(y / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[t$95$0, 500000000000.0], N[(x - N[(N[(N[(x + -1.0), $MachinePrecision] + N[(N[(N[(1.0 - x), $MachinePrecision] - N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y \cdot \left(1 - x\right)}{1 + y}\\
\mathbf{if}\;t\_0 \leq 0.2:\\
\;\;\;\;\mathsf{fma}\left(1 - x, \frac{y}{-1 - y}, 1\right)\\
\mathbf{elif}\;t\_0 \leq 500000000000:\\
\;\;\;\;x - \frac{\left(x + -1\right) + \frac{\left(1 - x\right) - \frac{1 - x}{y}}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \frac{y}{1 + y}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 0.20000000000000001Initial program 89.0%
sub-neg89.0%
+-commutative89.0%
associate-/l*100.0%
distribute-rgt-neg-in100.0%
fma-define100.0%
distribute-neg-frac2100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
if 0.20000000000000001 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 5e11Initial program 8.1%
associate-/l*8.1%
remove-double-neg8.1%
remove-double-neg8.1%
+-commutative8.1%
Simplified8.1%
Taylor expanded in y around -inf 100.0%
Simplified100.0%
if 5e11 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 61.4%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 61.4%
mul-1-neg61.4%
distribute-neg-frac261.4%
distribute-neg-in61.4%
metadata-eval61.4%
sub-neg61.4%
associate-*r/100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* y (- 1.0 x)) (+ 1.0 y))))
(if (<= t_0 0.2)
(+ 1.0 (* (/ y (- -1.0 y)) (- 1.0 x)))
(if (<= t_0 500000000000.0)
(- x (/ (+ (+ x -1.0) (/ (- (- 1.0 x) (/ (- 1.0 x) y)) y)) y))
(+ 1.0 (* x (/ y (+ 1.0 y))))))))
double code(double x, double y) {
double t_0 = (y * (1.0 - x)) / (1.0 + y);
double tmp;
if (t_0 <= 0.2) {
tmp = 1.0 + ((y / (-1.0 - y)) * (1.0 - x));
} else if (t_0 <= 500000000000.0) {
tmp = x - (((x + -1.0) + (((1.0 - x) - ((1.0 - x) / y)) / y)) / y);
} else {
tmp = 1.0 + (x * (y / (1.0 + y)));
}
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 * (1.0d0 - x)) / (1.0d0 + y)
if (t_0 <= 0.2d0) then
tmp = 1.0d0 + ((y / ((-1.0d0) - y)) * (1.0d0 - x))
else if (t_0 <= 500000000000.0d0) then
tmp = x - (((x + (-1.0d0)) + (((1.0d0 - x) - ((1.0d0 - x) / y)) / y)) / y)
else
tmp = 1.0d0 + (x * (y / (1.0d0 + y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y * (1.0 - x)) / (1.0 + y);
double tmp;
if (t_0 <= 0.2) {
tmp = 1.0 + ((y / (-1.0 - y)) * (1.0 - x));
} else if (t_0 <= 500000000000.0) {
tmp = x - (((x + -1.0) + (((1.0 - x) - ((1.0 - x) / y)) / y)) / y);
} else {
tmp = 1.0 + (x * (y / (1.0 + y)));
}
return tmp;
}
def code(x, y): t_0 = (y * (1.0 - x)) / (1.0 + y) tmp = 0 if t_0 <= 0.2: tmp = 1.0 + ((y / (-1.0 - y)) * (1.0 - x)) elif t_0 <= 500000000000.0: tmp = x - (((x + -1.0) + (((1.0 - x) - ((1.0 - x) / y)) / y)) / y) else: tmp = 1.0 + (x * (y / (1.0 + y))) return tmp
function code(x, y) t_0 = Float64(Float64(y * Float64(1.0 - x)) / Float64(1.0 + y)) tmp = 0.0 if (t_0 <= 0.2) tmp = Float64(1.0 + Float64(Float64(y / Float64(-1.0 - y)) * Float64(1.0 - x))); elseif (t_0 <= 500000000000.0) tmp = Float64(x - Float64(Float64(Float64(x + -1.0) + Float64(Float64(Float64(1.0 - x) - Float64(Float64(1.0 - x) / y)) / y)) / y)); else tmp = Float64(1.0 + Float64(x * Float64(y / Float64(1.0 + y)))); end return tmp end
function tmp_2 = code(x, y) t_0 = (y * (1.0 - x)) / (1.0 + y); tmp = 0.0; if (t_0 <= 0.2) tmp = 1.0 + ((y / (-1.0 - y)) * (1.0 - x)); elseif (t_0 <= 500000000000.0) tmp = x - (((x + -1.0) + (((1.0 - x) - ((1.0 - x) / y)) / y)) / y); else tmp = 1.0 + (x * (y / (1.0 + y))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.2], N[(1.0 + N[(N[(y / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision] * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 500000000000.0], N[(x - N[(N[(N[(x + -1.0), $MachinePrecision] + N[(N[(N[(1.0 - x), $MachinePrecision] - N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y \cdot \left(1 - x\right)}{1 + y}\\
\mathbf{if}\;t\_0 \leq 0.2:\\
\;\;\;\;1 + \frac{y}{-1 - y} \cdot \left(1 - x\right)\\
\mathbf{elif}\;t\_0 \leq 500000000000:\\
\;\;\;\;x - \frac{\left(x + -1\right) + \frac{\left(1 - x\right) - \frac{1 - x}{y}}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \frac{y}{1 + y}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 0.20000000000000001Initial program 89.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
if 0.20000000000000001 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 5e11Initial program 8.1%
associate-/l*8.1%
remove-double-neg8.1%
remove-double-neg8.1%
+-commutative8.1%
Simplified8.1%
Taylor expanded in y around -inf 100.0%
Simplified100.0%
if 5e11 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 61.4%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 61.4%
mul-1-neg61.4%
distribute-neg-frac261.4%
distribute-neg-in61.4%
metadata-eval61.4%
sub-neg61.4%
associate-*r/100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* y (- 1.0 x)) (+ 1.0 y))))
(if (<= t_0 0.2)
(+ 1.0 (* (/ y (- -1.0 y)) (- 1.0 x)))
(if (<= t_0 500000000000.0)
(+ x (/ (- (- 1.0 x) (/ (- 1.0 x) y)) y))
(+ 1.0 (* x (/ y (+ 1.0 y))))))))
double code(double x, double y) {
double t_0 = (y * (1.0 - x)) / (1.0 + y);
double tmp;
if (t_0 <= 0.2) {
tmp = 1.0 + ((y / (-1.0 - y)) * (1.0 - x));
} else if (t_0 <= 500000000000.0) {
tmp = x + (((1.0 - x) - ((1.0 - x) / y)) / y);
} else {
tmp = 1.0 + (x * (y / (1.0 + y)));
}
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 * (1.0d0 - x)) / (1.0d0 + y)
if (t_0 <= 0.2d0) then
tmp = 1.0d0 + ((y / ((-1.0d0) - y)) * (1.0d0 - x))
else if (t_0 <= 500000000000.0d0) then
tmp = x + (((1.0d0 - x) - ((1.0d0 - x) / y)) / y)
else
tmp = 1.0d0 + (x * (y / (1.0d0 + y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y * (1.0 - x)) / (1.0 + y);
double tmp;
if (t_0 <= 0.2) {
tmp = 1.0 + ((y / (-1.0 - y)) * (1.0 - x));
} else if (t_0 <= 500000000000.0) {
tmp = x + (((1.0 - x) - ((1.0 - x) / y)) / y);
} else {
tmp = 1.0 + (x * (y / (1.0 + y)));
}
return tmp;
}
def code(x, y): t_0 = (y * (1.0 - x)) / (1.0 + y) tmp = 0 if t_0 <= 0.2: tmp = 1.0 + ((y / (-1.0 - y)) * (1.0 - x)) elif t_0 <= 500000000000.0: tmp = x + (((1.0 - x) - ((1.0 - x) / y)) / y) else: tmp = 1.0 + (x * (y / (1.0 + y))) return tmp
function code(x, y) t_0 = Float64(Float64(y * Float64(1.0 - x)) / Float64(1.0 + y)) tmp = 0.0 if (t_0 <= 0.2) tmp = Float64(1.0 + Float64(Float64(y / Float64(-1.0 - y)) * Float64(1.0 - x))); elseif (t_0 <= 500000000000.0) tmp = Float64(x + Float64(Float64(Float64(1.0 - x) - Float64(Float64(1.0 - x) / y)) / y)); else tmp = Float64(1.0 + Float64(x * Float64(y / Float64(1.0 + y)))); end return tmp end
function tmp_2 = code(x, y) t_0 = (y * (1.0 - x)) / (1.0 + y); tmp = 0.0; if (t_0 <= 0.2) tmp = 1.0 + ((y / (-1.0 - y)) * (1.0 - x)); elseif (t_0 <= 500000000000.0) tmp = x + (((1.0 - x) - ((1.0 - x) / y)) / y); else tmp = 1.0 + (x * (y / (1.0 + y))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.2], N[(1.0 + N[(N[(y / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision] * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 500000000000.0], N[(x + N[(N[(N[(1.0 - x), $MachinePrecision] - N[(N[(1.0 - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y \cdot \left(1 - x\right)}{1 + y}\\
\mathbf{if}\;t\_0 \leq 0.2:\\
\;\;\;\;1 + \frac{y}{-1 - y} \cdot \left(1 - x\right)\\
\mathbf{elif}\;t\_0 \leq 500000000000:\\
\;\;\;\;x + \frac{\left(1 - x\right) - \frac{1 - x}{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \frac{y}{1 + y}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 0.20000000000000001Initial program 89.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
if 0.20000000000000001 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 5e11Initial program 8.1%
associate-/l*8.1%
remove-double-neg8.1%
remove-double-neg8.1%
+-commutative8.1%
Simplified8.1%
Taylor expanded in y around -inf 99.8%
mul-1-neg99.8%
unsub-neg99.8%
distribute-lft-out--99.8%
Simplified99.8%
if 5e11 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 61.4%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 61.4%
mul-1-neg61.4%
distribute-neg-frac261.4%
distribute-neg-in61.4%
metadata-eval61.4%
sub-neg61.4%
associate-*r/100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* y (- 1.0 x)) (+ 1.0 y))))
(if (<= t_0 1.0)
(+ 1.0 (* (/ y (- -1.0 y)) (- 1.0 x)))
(if (<= t_0 500000000000.0)
(- x (/ -1.0 y))
(+ 1.0 (* x (/ y (+ 1.0 y))))))))
double code(double x, double y) {
double t_0 = (y * (1.0 - x)) / (1.0 + y);
double tmp;
if (t_0 <= 1.0) {
tmp = 1.0 + ((y / (-1.0 - y)) * (1.0 - x));
} else if (t_0 <= 500000000000.0) {
tmp = x - (-1.0 / y);
} else {
tmp = 1.0 + (x * (y / (1.0 + y)));
}
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 * (1.0d0 - x)) / (1.0d0 + y)
if (t_0 <= 1.0d0) then
tmp = 1.0d0 + ((y / ((-1.0d0) - y)) * (1.0d0 - x))
else if (t_0 <= 500000000000.0d0) then
tmp = x - ((-1.0d0) / y)
else
tmp = 1.0d0 + (x * (y / (1.0d0 + y)))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y * (1.0 - x)) / (1.0 + y);
double tmp;
if (t_0 <= 1.0) {
tmp = 1.0 + ((y / (-1.0 - y)) * (1.0 - x));
} else if (t_0 <= 500000000000.0) {
tmp = x - (-1.0 / y);
} else {
tmp = 1.0 + (x * (y / (1.0 + y)));
}
return tmp;
}
def code(x, y): t_0 = (y * (1.0 - x)) / (1.0 + y) tmp = 0 if t_0 <= 1.0: tmp = 1.0 + ((y / (-1.0 - y)) * (1.0 - x)) elif t_0 <= 500000000000.0: tmp = x - (-1.0 / y) else: tmp = 1.0 + (x * (y / (1.0 + y))) return tmp
function code(x, y) t_0 = Float64(Float64(y * Float64(1.0 - x)) / Float64(1.0 + y)) tmp = 0.0 if (t_0 <= 1.0) tmp = Float64(1.0 + Float64(Float64(y / Float64(-1.0 - y)) * Float64(1.0 - x))); elseif (t_0 <= 500000000000.0) tmp = Float64(x - Float64(-1.0 / y)); else tmp = Float64(1.0 + Float64(x * Float64(y / Float64(1.0 + y)))); end return tmp end
function tmp_2 = code(x, y) t_0 = (y * (1.0 - x)) / (1.0 + y); tmp = 0.0; if (t_0 <= 1.0) tmp = 1.0 + ((y / (-1.0 - y)) * (1.0 - x)); elseif (t_0 <= 500000000000.0) tmp = x - (-1.0 / y); else tmp = 1.0 + (x * (y / (1.0 + y))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1.0], N[(1.0 + N[(N[(y / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision] * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 500000000000.0], N[(x - N[(-1.0 / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(y / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y \cdot \left(1 - x\right)}{1 + y}\\
\mathbf{if}\;t\_0 \leq 1:\\
\;\;\;\;1 + \frac{y}{-1 - y} \cdot \left(1 - x\right)\\
\mathbf{elif}\;t\_0 \leq 500000000000:\\
\;\;\;\;x - \frac{-1}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot \frac{y}{1 + y}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 1Initial program 59.9%
associate-/l*67.1%
remove-double-neg67.1%
remove-double-neg67.1%
+-commutative67.1%
Simplified67.1%
if 1 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 5e11Initial program 73.7%
associate-/l*73.7%
remove-double-neg73.7%
remove-double-neg73.7%
+-commutative73.7%
Simplified73.7%
Taylor expanded in y around -inf 100.0%
associate-*r/100.0%
mul-1-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
if 5e11 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 61.4%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 61.4%
mul-1-neg61.4%
distribute-neg-frac261.4%
distribute-neg-in61.4%
metadata-eval61.4%
sub-neg61.4%
associate-*r/100.0%
Simplified100.0%
Final simplification73.4%
(FPCore (x y)
:precision binary64
(if (<= y -1.0)
x
(if (<= y 5.5e-81)
1.0
(if (<= y 1.7e-7) (* x y) (if (<= y 3.5e+70) (/ 1.0 y) x)))))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 5.5e-81) {
tmp = 1.0;
} else if (y <= 1.7e-7) {
tmp = x * y;
} else if (y <= 3.5e+70) {
tmp = 1.0 / 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 <= 5.5d-81) then
tmp = 1.0d0
else if (y <= 1.7d-7) then
tmp = x * y
else if (y <= 3.5d+70) then
tmp = 1.0d0 / 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 <= 5.5e-81) {
tmp = 1.0;
} else if (y <= 1.7e-7) {
tmp = x * y;
} else if (y <= 3.5e+70) {
tmp = 1.0 / y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= 5.5e-81: tmp = 1.0 elif y <= 1.7e-7: tmp = x * y elif y <= 3.5e+70: tmp = 1.0 / y else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = x; elseif (y <= 5.5e-81) tmp = 1.0; elseif (y <= 1.7e-7) tmp = Float64(x * y); elseif (y <= 3.5e+70) tmp = Float64(1.0 / 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 <= 5.5e-81) tmp = 1.0; elseif (y <= 1.7e-7) tmp = x * y; elseif (y <= 3.5e+70) tmp = 1.0 / y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], x, If[LessEqual[y, 5.5e-81], 1.0, If[LessEqual[y, 1.7e-7], N[(x * y), $MachinePrecision], If[LessEqual[y, 3.5e+70], N[(1.0 / y), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-81}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-7}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+70}:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 3.50000000000000002e70 < y Initial program 27.0%
associate-/l*53.5%
remove-double-neg53.5%
remove-double-neg53.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in y around inf 78.2%
if -1 < y < 5.50000000000000026e-81Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
distribute-neg-frac2100.0%
distribute-neg-in100.0%
metadata-eval100.0%
sub-neg100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around 0 80.9%
if 5.50000000000000026e-81 < y < 1.69999999999999987e-7Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.4%
mul-1-neg99.4%
distribute-neg-frac299.4%
distribute-neg-in99.4%
metadata-eval99.4%
sub-neg99.4%
associate-*r/99.4%
Simplified99.4%
Taylor expanded in x around inf 62.8%
+-commutative62.8%
Simplified62.8%
Taylor expanded in y around 0 61.9%
*-commutative61.9%
Simplified61.9%
if 1.69999999999999987e-7 < y < 3.50000000000000002e70Initial program 26.9%
associate-/l*27.0%
remove-double-neg27.0%
remove-double-neg27.0%
+-commutative27.0%
Simplified27.0%
Taylor expanded in y around -inf 91.6%
associate-*r/91.6%
mul-1-neg91.6%
neg-sub091.6%
associate-+l-91.6%
neg-sub091.6%
+-commutative91.6%
sub-neg91.6%
Simplified91.6%
Taylor expanded in x around 0 61.4%
Final simplification76.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- x (/ -1.0 y))))
(if (<= y -1.0)
t_0
(if (<= y 5.8e-81) 1.0 (if (<= y 1.7e-7) (* 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 <= 5.8e-81) {
tmp = 1.0;
} else if (y <= 1.7e-7) {
tmp = 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 <= 5.8d-81) then
tmp = 1.0d0
else if (y <= 1.7d-7) then
tmp = 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 <= 5.8e-81) {
tmp = 1.0;
} else if (y <= 1.7e-7) {
tmp = 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 <= 5.8e-81: tmp = 1.0 elif y <= 1.7e-7: tmp = 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 <= 5.8e-81) tmp = 1.0; elseif (y <= 1.7e-7) tmp = 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 <= 5.8e-81) tmp = 1.0; elseif (y <= 1.7e-7) tmp = 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, 5.8e-81], 1.0, If[LessEqual[y, 1.7e-7], N[(x * y), $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 5.8 \cdot 10^{-81}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-7}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1 or 1.69999999999999987e-7 < y Initial program 27.0%
associate-/l*50.4%
remove-double-neg50.4%
remove-double-neg50.4%
+-commutative50.4%
Simplified50.4%
Taylor expanded in y around -inf 99.0%
associate-*r/99.0%
mul-1-neg99.0%
neg-sub099.0%
associate-+l-99.0%
neg-sub099.0%
+-commutative99.0%
sub-neg99.0%
Simplified99.0%
Taylor expanded in x around 0 99.0%
if -1 < y < 5.79999999999999978e-81Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
distribute-neg-frac2100.0%
distribute-neg-in100.0%
metadata-eval100.0%
sub-neg100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around 0 80.9%
if 5.79999999999999978e-81 < y < 1.69999999999999987e-7Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.4%
mul-1-neg99.4%
distribute-neg-frac299.4%
distribute-neg-in99.4%
metadata-eval99.4%
sub-neg99.4%
associate-*r/99.4%
Simplified99.4%
Taylor expanded in x around inf 62.8%
+-commutative62.8%
Simplified62.8%
Taylor expanded in y around 0 61.9%
*-commutative61.9%
Simplified61.9%
Final simplification89.2%
(FPCore (x y) :precision binary64 (if (<= y -1.0) x (if (<= y 4.1e-81) 1.0 (if (<= y 1.7e-7) (* x y) x))))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 4.1e-81) {
tmp = 1.0;
} else if (y <= 1.7e-7) {
tmp = 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 <= 4.1d-81) then
tmp = 1.0d0
else if (y <= 1.7d-7) then
tmp = 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 <= 4.1e-81) {
tmp = 1.0;
} else if (y <= 1.7e-7) {
tmp = x * y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= 4.1e-81: tmp = 1.0 elif y <= 1.7e-7: tmp = x * y else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = x; elseif (y <= 4.1e-81) tmp = 1.0; elseif (y <= 1.7e-7) tmp = 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 <= 4.1e-81) tmp = 1.0; elseif (y <= 1.7e-7) tmp = x * y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], x, If[LessEqual[y, 4.1e-81], 1.0, If[LessEqual[y, 1.7e-7], N[(x * y), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-81}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-7}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 1.69999999999999987e-7 < y Initial program 27.0%
associate-/l*50.4%
remove-double-neg50.4%
remove-double-neg50.4%
+-commutative50.4%
Simplified50.4%
Taylor expanded in y around inf 73.0%
if -1 < y < 4.09999999999999984e-81Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
mul-1-neg100.0%
distribute-neg-frac2100.0%
distribute-neg-in100.0%
metadata-eval100.0%
sub-neg100.0%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around 0 80.9%
if 4.09999999999999984e-81 < y < 1.69999999999999987e-7Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.4%
mul-1-neg99.4%
distribute-neg-frac299.4%
distribute-neg-in99.4%
metadata-eval99.4%
sub-neg99.4%
associate-*r/99.4%
Simplified99.4%
Taylor expanded in x around inf 62.8%
+-commutative62.8%
Simplified62.8%
Taylor expanded in y around 0 61.9%
*-commutative61.9%
Simplified61.9%
Final simplification75.1%
(FPCore (x y) :precision binary64 (if (or (<= y -1.0) (not (<= y 0.82))) (- x (/ -1.0 y)) (- 1.0 (* y (- 1.0 x)))))
double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 0.82)) {
tmp = x - (-1.0 / y);
} else {
tmp = 1.0 - (y * (1.0 - 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)) .or. (.not. (y <= 0.82d0))) then
tmp = x - ((-1.0d0) / y)
else
tmp = 1.0d0 - (y * (1.0d0 - x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 0.82)) {
tmp = x - (-1.0 / y);
} else {
tmp = 1.0 - (y * (1.0 - x));
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.0) or not (y <= 0.82): tmp = x - (-1.0 / y) else: tmp = 1.0 - (y * (1.0 - x)) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.0) || !(y <= 0.82)) tmp = Float64(x - Float64(-1.0 / y)); else tmp = Float64(1.0 - Float64(y * Float64(1.0 - x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.0) || ~((y <= 0.82))) tmp = x - (-1.0 / y); else tmp = 1.0 - (y * (1.0 - x)); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 0.82]], $MachinePrecision]], N[(x - N[(-1.0 / y), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 0.82\right):\\
\;\;\;\;x - \frac{-1}{y}\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot \left(1 - x\right)\\
\end{array}
\end{array}
if y < -1 or 0.819999999999999951 < y Initial program 26.5%
associate-/l*50.1%
remove-double-neg50.1%
remove-double-neg50.1%
+-commutative50.1%
Simplified50.1%
Taylor expanded in y around -inf 99.7%
associate-*r/99.7%
mul-1-neg99.7%
neg-sub099.7%
associate-+l-99.7%
neg-sub099.7%
+-commutative99.7%
sub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
if -1 < y < 0.819999999999999951Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 99.7%
Final simplification99.7%
(FPCore (x y) :precision binary64 (if (or (<= y -1.0) (not (<= y 1.0))) (- x (/ -1.0 y)) (+ 1.0 (* x y))))
double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 1.0)) {
tmp = x - (-1.0 / y);
} else {
tmp = 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 <= (-1.0d0)) .or. (.not. (y <= 1.0d0))) then
tmp = x - ((-1.0d0) / y)
else
tmp = 1.0d0 + (x * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.0) || !(y <= 1.0)) {
tmp = x - (-1.0 / y);
} else {
tmp = 1.0 + (x * y);
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.0) or not (y <= 1.0): tmp = x - (-1.0 / y) else: tmp = 1.0 + (x * y) return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.0) || !(y <= 1.0)) tmp = Float64(x - Float64(-1.0 / y)); else tmp = Float64(1.0 + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.0) || ~((y <= 1.0))) tmp = x - (-1.0 / y); else tmp = 1.0 + (x * y); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 1.0]], $MachinePrecision]], N[(x - N[(-1.0 / y), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 1\right):\\
\;\;\;\;x - \frac{-1}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + x \cdot y\\
\end{array}
\end{array}
if y < -1 or 1 < y Initial program 26.5%
associate-/l*50.1%
remove-double-neg50.1%
remove-double-neg50.1%
+-commutative50.1%
Simplified50.1%
Taylor expanded in y around -inf 99.7%
associate-*r/99.7%
mul-1-neg99.7%
neg-sub099.7%
associate-+l-99.7%
neg-sub099.7%
+-commutative99.7%
sub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
if -1 < y < 1Initial program 100.0%
associate-/l*100.0%
remove-double-neg100.0%
remove-double-neg100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.5%
mul-1-neg99.5%
distribute-neg-frac299.5%
distribute-neg-in99.5%
metadata-eval99.5%
sub-neg99.5%
associate-*r/99.5%
Simplified99.5%
Taylor expanded in y around 0 99.3%
+-commutative99.3%
Simplified99.3%
Final simplification99.5%
(FPCore (x y) :precision binary64 (if (<= y -1.0) x (if (<= y 6600000.0) 1.0 x)))
double code(double x, double y) {
double tmp;
if (y <= -1.0) {
tmp = x;
} else if (y <= 6600000.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 <= 6600000.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 <= 6600000.0) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.0: tmp = x elif y <= 6600000.0: tmp = 1.0 else: tmp = x return tmp
function code(x, y) tmp = 0.0 if (y <= -1.0) tmp = x; elseif (y <= 6600000.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 <= 6600000.0) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.0], x, If[LessEqual[y, 6600000.0], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6600000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1 or 6.6e6 < y Initial program 26.2%
associate-/l*49.9%
remove-double-neg49.9%
remove-double-neg49.9%
+-commutative49.9%
Simplified49.9%
Taylor expanded in y around inf 74.0%
if -1 < y < 6.6e6Initial program 99.8%
associate-/l*99.8%
remove-double-neg99.8%
remove-double-neg99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 98.7%
mul-1-neg98.7%
distribute-neg-frac298.7%
distribute-neg-in98.7%
metadata-eval98.7%
sub-neg98.7%
associate-*r/98.7%
Simplified98.7%
Taylor expanded in x around 0 72.6%
(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 60.4%
associate-/l*73.1%
remove-double-neg73.1%
remove-double-neg73.1%
+-commutative73.1%
Simplified73.1%
Taylor expanded in x around inf 59.2%
mul-1-neg59.2%
distribute-neg-frac259.2%
distribute-neg-in59.2%
metadata-eval59.2%
sub-neg59.2%
associate-*r/71.9%
Simplified71.9%
Taylor expanded in x around 0 35.7%
(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 2024150
(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))))