
(FPCore (x y) :precision binary64 (+ x (* (- 1.0 x) (- 1.0 y))))
double code(double x, double y) {
return x + ((1.0 - x) * (1.0 - y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + ((1.0d0 - x) * (1.0d0 - y))
end function
public static double code(double x, double y) {
return x + ((1.0 - x) * (1.0 - y));
}
def code(x, y): return x + ((1.0 - x) * (1.0 - y))
function code(x, y) return Float64(x + Float64(Float64(1.0 - x) * Float64(1.0 - y))) end
function tmp = code(x, y) tmp = x + ((1.0 - x) * (1.0 - y)); end
code[x_, y_] := N[(x + N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(1 - x\right) \cdot \left(1 - y\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (+ x (* (- 1.0 x) (- 1.0 y))))
double code(double x, double y) {
return x + ((1.0 - x) * (1.0 - y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + ((1.0d0 - x) * (1.0d0 - y))
end function
public static double code(double x, double y) {
return x + ((1.0 - x) * (1.0 - y));
}
def code(x, y): return x + ((1.0 - x) * (1.0 - y))
function code(x, y) return Float64(x + Float64(Float64(1.0 - x) * Float64(1.0 - y))) end
function tmp = code(x, y) tmp = x + ((1.0 - x) * (1.0 - y)); end
code[x_, y_] := N[(x + N[(N[(1.0 - x), $MachinePrecision] * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(1 - x\right) \cdot \left(1 - y\right)
\end{array}
(FPCore (x y) :precision binary64 (+ 1.0 (* y (+ x -1.0))))
double code(double x, double y) {
return 1.0 + (y * (x + -1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 + (y * (x + (-1.0d0)))
end function
public static double code(double x, double y) {
return 1.0 + (y * (x + -1.0));
}
def code(x, y): return 1.0 + (y * (x + -1.0))
function code(x, y) return Float64(1.0 + Float64(y * Float64(x + -1.0))) end
function tmp = code(x, y) tmp = 1.0 + (y * (x + -1.0)); end
code[x_, y_] := N[(1.0 + N[(y * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + y \cdot \left(x + -1\right)
\end{array}
Initial program 76.4%
+-commutative76.4%
remove-double-neg76.4%
unsub-neg76.4%
sub-neg76.4%
+-commutative76.4%
distribute-rgt-in76.4%
*-lft-identity76.4%
associate--l+87.7%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
(FPCore (x y)
:precision binary64
(if (<= y -2.75e+17)
(- y)
(if (<= y -1.8e-41)
(* y x)
(if (<= y 5.8e-49)
1.0
(if (or (<= y 12000000000.0) (not (<= y 4.9e+228))) (* y x) (- y))))))
double code(double x, double y) {
double tmp;
if (y <= -2.75e+17) {
tmp = -y;
} else if (y <= -1.8e-41) {
tmp = y * x;
} else if (y <= 5.8e-49) {
tmp = 1.0;
} else if ((y <= 12000000000.0) || !(y <= 4.9e+228)) {
tmp = y * x;
} else {
tmp = -y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-2.75d+17)) then
tmp = -y
else if (y <= (-1.8d-41)) then
tmp = y * x
else if (y <= 5.8d-49) then
tmp = 1.0d0
else if ((y <= 12000000000.0d0) .or. (.not. (y <= 4.9d+228))) then
tmp = y * x
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -2.75e+17) {
tmp = -y;
} else if (y <= -1.8e-41) {
tmp = y * x;
} else if (y <= 5.8e-49) {
tmp = 1.0;
} else if ((y <= 12000000000.0) || !(y <= 4.9e+228)) {
tmp = y * x;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -2.75e+17: tmp = -y elif y <= -1.8e-41: tmp = y * x elif y <= 5.8e-49: tmp = 1.0 elif (y <= 12000000000.0) or not (y <= 4.9e+228): tmp = y * x else: tmp = -y return tmp
function code(x, y) tmp = 0.0 if (y <= -2.75e+17) tmp = Float64(-y); elseif (y <= -1.8e-41) tmp = Float64(y * x); elseif (y <= 5.8e-49) tmp = 1.0; elseif ((y <= 12000000000.0) || !(y <= 4.9e+228)) tmp = Float64(y * x); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -2.75e+17) tmp = -y; elseif (y <= -1.8e-41) tmp = y * x; elseif (y <= 5.8e-49) tmp = 1.0; elseif ((y <= 12000000000.0) || ~((y <= 4.9e+228))) tmp = y * x; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -2.75e+17], (-y), If[LessEqual[y, -1.8e-41], N[(y * x), $MachinePrecision], If[LessEqual[y, 5.8e-49], 1.0, If[Or[LessEqual[y, 12000000000.0], N[Not[LessEqual[y, 4.9e+228]], $MachinePrecision]], N[(y * x), $MachinePrecision], (-y)]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.75 \cdot 10^{+17}:\\
\;\;\;\;-y\\
\mathbf{elif}\;y \leq -1.8 \cdot 10^{-41}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-49}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 12000000000 \lor \neg \left(y \leq 4.9 \cdot 10^{+228}\right):\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < -2.75e17 or 1.2e10 < y < 4.9000000000000002e228Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
*-lft-identity100.0%
associate--l+100.0%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Taylor expanded in x around inf 99.8%
Taylor expanded in x around 0 59.2%
neg-mul-159.2%
Simplified59.2%
if -2.75e17 < y < -1.8e-41 or 5.8e-49 < y < 1.2e10 or 4.9000000000000002e228 < y Initial program 75.7%
+-commutative75.7%
remove-double-neg75.7%
unsub-neg75.7%
sub-neg75.7%
+-commutative75.7%
distribute-rgt-in75.8%
*-lft-identity75.8%
associate--l+97.6%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in y around inf 82.5%
Taylor expanded in x around inf 68.3%
if -1.8e-41 < y < 5.8e-49Initial program 57.2%
+-commutative57.2%
remove-double-neg57.2%
unsub-neg57.2%
sub-neg57.2%
+-commutative57.2%
distribute-rgt-in57.2%
*-lft-identity57.2%
associate--l+74.1%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 81.5%
Final simplification70.9%
(FPCore (x y) :precision binary64 (if (or (<= x -1.0) (not (<= x 4e-7))) (+ 1.0 (* y x)) (- 1.0 y)))
double code(double x, double y) {
double tmp;
if ((x <= -1.0) || !(x <= 4e-7)) {
tmp = 1.0 + (y * x);
} else {
tmp = 1.0 - y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-1.0d0)) .or. (.not. (x <= 4d-7))) then
tmp = 1.0d0 + (y * x)
else
tmp = 1.0d0 - y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -1.0) || !(x <= 4e-7)) {
tmp = 1.0 + (y * x);
} else {
tmp = 1.0 - y;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -1.0) or not (x <= 4e-7): tmp = 1.0 + (y * x) else: tmp = 1.0 - y return tmp
function code(x, y) tmp = 0.0 if ((x <= -1.0) || !(x <= 4e-7)) tmp = Float64(1.0 + Float64(y * x)); else tmp = Float64(1.0 - y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -1.0) || ~((x <= 4e-7))) tmp = 1.0 + (y * x); else tmp = 1.0 - y; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -1.0], N[Not[LessEqual[x, 4e-7]], $MachinePrecision]], N[(1.0 + N[(y * x), $MachinePrecision]), $MachinePrecision], N[(1.0 - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \lor \neg \left(x \leq 4 \cdot 10^{-7}\right):\\
\;\;\;\;1 + y \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 - y\\
\end{array}
\end{array}
if x < -1 or 3.9999999999999998e-7 < x Initial program 53.5%
+-commutative53.5%
remove-double-neg53.5%
unsub-neg53.5%
sub-neg53.5%
+-commutative53.5%
distribute-rgt-in53.5%
*-lft-identity53.5%
associate--l+75.8%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 98.7%
*-commutative98.7%
Simplified98.7%
if -1 < x < 3.9999999999999998e-7Initial program 100.0%
+-commutative100.0%
remove-double-neg100.0%
unsub-neg100.0%
sub-neg100.0%
+-commutative100.0%
distribute-rgt-in100.0%
*-lft-identity100.0%
associate--l+100.0%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 99.7%
neg-mul-199.7%
unsub-neg99.7%
Simplified99.7%
Final simplification99.2%
(FPCore (x y) :precision binary64 (if (or (<= y -1.12e-63) (not (<= y 1.8e-48))) (* y (+ x -1.0)) (- 1.0 y)))
double code(double x, double y) {
double tmp;
if ((y <= -1.12e-63) || !(y <= 1.8e-48)) {
tmp = y * (x + -1.0);
} else {
tmp = 1.0 - 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.12d-63)) .or. (.not. (y <= 1.8d-48))) then
tmp = y * (x + (-1.0d0))
else
tmp = 1.0d0 - y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -1.12e-63) || !(y <= 1.8e-48)) {
tmp = y * (x + -1.0);
} else {
tmp = 1.0 - y;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -1.12e-63) or not (y <= 1.8e-48): tmp = y * (x + -1.0) else: tmp = 1.0 - y return tmp
function code(x, y) tmp = 0.0 if ((y <= -1.12e-63) || !(y <= 1.8e-48)) tmp = Float64(y * Float64(x + -1.0)); else tmp = Float64(1.0 - y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -1.12e-63) || ~((y <= 1.8e-48))) tmp = y * (x + -1.0); else tmp = 1.0 - y; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -1.12e-63], N[Not[LessEqual[y, 1.8e-48]], $MachinePrecision]], N[(y * N[(x + -1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{-63} \lor \neg \left(y \leq 1.8 \cdot 10^{-48}\right):\\
\;\;\;\;y \cdot \left(x + -1\right)\\
\mathbf{else}:\\
\;\;\;\;1 - y\\
\end{array}
\end{array}
if y < -1.12000000000000002e-63 or 1.8000000000000001e-48 < y Initial program 91.6%
+-commutative91.6%
remove-double-neg91.6%
unsub-neg91.6%
sub-neg91.6%
+-commutative91.6%
distribute-rgt-in91.6%
*-lft-identity91.6%
associate--l+99.3%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Taylor expanded in x around inf 93.0%
if -1.12000000000000002e-63 < y < 1.8000000000000001e-48Initial program 57.4%
+-commutative57.4%
remove-double-neg57.4%
unsub-neg57.4%
sub-neg57.4%
+-commutative57.4%
distribute-rgt-in57.4%
*-lft-identity57.4%
associate--l+73.2%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 82.5%
neg-mul-182.5%
unsub-neg82.5%
Simplified82.5%
Final simplification88.4%
(FPCore (x y) :precision binary64 (if (or (<= x -1.38e+42) (not (<= x 1.4e+42))) (* y x) (- 1.0 y)))
double code(double x, double y) {
double tmp;
if ((x <= -1.38e+42) || !(x <= 1.4e+42)) {
tmp = y * x;
} else {
tmp = 1.0 - y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-1.38d+42)) .or. (.not. (x <= 1.4d+42))) then
tmp = y * x
else
tmp = 1.0d0 - y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -1.38e+42) || !(x <= 1.4e+42)) {
tmp = y * x;
} else {
tmp = 1.0 - y;
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -1.38e+42) or not (x <= 1.4e+42): tmp = y * x else: tmp = 1.0 - y return tmp
function code(x, y) tmp = 0.0 if ((x <= -1.38e+42) || !(x <= 1.4e+42)) tmp = Float64(y * x); else tmp = Float64(1.0 - y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -1.38e+42) || ~((x <= 1.4e+42))) tmp = y * x; else tmp = 1.0 - y; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -1.38e+42], N[Not[LessEqual[x, 1.4e+42]], $MachinePrecision]], N[(y * x), $MachinePrecision], N[(1.0 - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.38 \cdot 10^{+42} \lor \neg \left(x \leq 1.4 \cdot 10^{+42}\right):\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 - y\\
\end{array}
\end{array}
if x < -1.3800000000000001e42 or 1.4e42 < x Initial program 50.7%
+-commutative50.7%
remove-double-neg50.7%
unsub-neg50.7%
sub-neg50.7%
+-commutative50.7%
distribute-rgt-in50.8%
*-lft-identity50.8%
associate--l+77.8%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Taylor expanded in x around inf 77.8%
if -1.3800000000000001e42 < x < 1.4e42Initial program 94.8%
+-commutative94.8%
remove-double-neg94.8%
unsub-neg94.8%
sub-neg94.8%
+-commutative94.8%
distribute-rgt-in94.8%
*-lft-identity94.8%
associate--l+94.8%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around 0 95.2%
neg-mul-195.2%
unsub-neg95.2%
Simplified95.2%
Final simplification87.9%
(FPCore (x y) :precision binary64 (if (or (<= y -7.8e-8) (not (<= y 12.8))) (- y) 1.0))
double code(double x, double y) {
double tmp;
if ((y <= -7.8e-8) || !(y <= 12.8)) {
tmp = -y;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-7.8d-8)) .or. (.not. (y <= 12.8d0))) then
tmp = -y
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -7.8e-8) || !(y <= 12.8)) {
tmp = -y;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -7.8e-8) or not (y <= 12.8): tmp = -y else: tmp = 1.0 return tmp
function code(x, y) tmp = 0.0 if ((y <= -7.8e-8) || !(y <= 12.8)) tmp = Float64(-y); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -7.8e-8) || ~((y <= 12.8))) tmp = -y; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -7.8e-8], N[Not[LessEqual[y, 12.8]], $MachinePrecision]], (-y), 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-8} \lor \neg \left(y \leq 12.8\right):\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < -7.7999999999999997e-8 or 12.800000000000001 < y Initial program 99.6%
+-commutative99.6%
remove-double-neg99.6%
unsub-neg99.6%
sub-neg99.6%
+-commutative99.6%
distribute-rgt-in99.7%
*-lft-identity99.7%
associate--l+100.0%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Taylor expanded in x around inf 98.9%
Taylor expanded in x around 0 52.5%
neg-mul-152.5%
Simplified52.5%
if -7.7999999999999997e-8 < y < 12.800000000000001Initial program 55.9%
+-commutative55.9%
remove-double-neg55.9%
unsub-neg55.9%
sub-neg55.9%
+-commutative55.9%
distribute-rgt-in55.9%
*-lft-identity55.9%
associate--l+76.8%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 75.2%
Final simplification64.5%
(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 76.4%
+-commutative76.4%
remove-double-neg76.4%
unsub-neg76.4%
sub-neg76.4%
+-commutative76.4%
distribute-rgt-in76.4%
*-lft-identity76.4%
associate--l+87.7%
associate--l-100.0%
sub-neg100.0%
+-inverses100.0%
metadata-eval100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
neg-sub0100.0%
associate--r-100.0%
metadata-eval100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 41.2%
(FPCore (x y) :precision binary64 (- (* y x) (- y 1.0)))
double code(double x, double y) {
return (y * x) - (y - 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y * x) - (y - 1.0d0)
end function
public static double code(double x, double y) {
return (y * x) - (y - 1.0);
}
def code(x, y): return (y * x) - (y - 1.0)
function code(x, y) return Float64(Float64(y * x) - Float64(y - 1.0)) end
function tmp = code(x, y) tmp = (y * x) - (y - 1.0); end
code[x_, y_] := N[(N[(y * x), $MachinePrecision] - N[(y - 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot x - \left(y - 1\right)
\end{array}
herbie shell --seed 2024108
(FPCore (x y)
:name "Graphics.Rendering.Chart.Plot.Vectors:renderPlotVectors from Chart-1.5.3"
:precision binary64
:alt
(- (* y x) (- y 1.0))
(+ x (* (- 1.0 x) (- 1.0 y))))