
(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 8 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)) y))
double code(double x, double y) {
return (1.0 + (y * x)) - y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (1.0d0 + (y * x)) - y
end function
public static double code(double x, double y) {
return (1.0 + (y * x)) - y;
}
def code(x, y): return (1.0 + (y * x)) - y
function code(x, y) return Float64(Float64(1.0 + Float64(y * x)) - y) end
function tmp = code(x, y) tmp = (1.0 + (y * x)) - y; end
code[x_, y_] := N[(N[(1.0 + N[(y * x), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\left(1 + y \cdot x\right) - y
\end{array}
Initial program 78.1%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified100.0%
distribute-rgt-inN/A
associate-+r+N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Applied egg-rr100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (* y x) y)))
(if (<= (- 1.0 y) -50000.0)
t_0
(if (<= (- 1.0 y) 1.01) (+ 1.0 (* y x)) t_0))))
double code(double x, double y) {
double t_0 = (y * x) - y;
double tmp;
if ((1.0 - y) <= -50000.0) {
tmp = t_0;
} else if ((1.0 - y) <= 1.01) {
tmp = 1.0 + (y * x);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (y * x) - y
if ((1.0d0 - y) <= (-50000.0d0)) then
tmp = t_0
else if ((1.0d0 - y) <= 1.01d0) then
tmp = 1.0d0 + (y * x)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y * x) - y;
double tmp;
if ((1.0 - y) <= -50000.0) {
tmp = t_0;
} else if ((1.0 - y) <= 1.01) {
tmp = 1.0 + (y * x);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (y * x) - y tmp = 0 if (1.0 - y) <= -50000.0: tmp = t_0 elif (1.0 - y) <= 1.01: tmp = 1.0 + (y * x) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(y * x) - y) tmp = 0.0 if (Float64(1.0 - y) <= -50000.0) tmp = t_0; elseif (Float64(1.0 - y) <= 1.01) tmp = Float64(1.0 + Float64(y * x)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (y * x) - y; tmp = 0.0; if ((1.0 - y) <= -50000.0) tmp = t_0; elseif ((1.0 - y) <= 1.01) tmp = 1.0 + (y * x); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * x), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[N[(1.0 - y), $MachinePrecision], -50000.0], t$95$0, If[LessEqual[N[(1.0 - y), $MachinePrecision], 1.01], N[(1.0 + N[(y * x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot x - y\\
\mathbf{if}\;1 - y \leq -50000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;1 - y \leq 1.01:\\
\;\;\;\;1 + y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) y) < -5e4 or 1.01000000000000001 < (-.f64 #s(literal 1 binary64) y) Initial program 99.9%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6497.4%
Simplified97.4%
distribute-rgt-inN/A
*-commutativeN/A
neg-mul-1N/A
sub-negN/A
--lowering--.f64N/A
*-lowering-*.f6497.5%
Applied egg-rr97.5%
if -5e4 < (-.f64 #s(literal 1 binary64) y) < 1.01000000000000001Initial program 52.2%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified100.0%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6498.4%
Simplified98.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (+ x -1.0))))
(if (<= (- 1.0 y) -50000.0)
t_0
(if (<= (- 1.0 y) 1.01) (+ 1.0 (* y x)) t_0))))
double code(double x, double y) {
double t_0 = y * (x + -1.0);
double tmp;
if ((1.0 - y) <= -50000.0) {
tmp = t_0;
} else if ((1.0 - y) <= 1.01) {
tmp = 1.0 + (y * x);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = y * (x + (-1.0d0))
if ((1.0d0 - y) <= (-50000.0d0)) then
tmp = t_0
else if ((1.0d0 - y) <= 1.01d0) then
tmp = 1.0d0 + (y * x)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * (x + -1.0);
double tmp;
if ((1.0 - y) <= -50000.0) {
tmp = t_0;
} else if ((1.0 - y) <= 1.01) {
tmp = 1.0 + (y * x);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = y * (x + -1.0) tmp = 0 if (1.0 - y) <= -50000.0: tmp = t_0 elif (1.0 - y) <= 1.01: tmp = 1.0 + (y * x) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(y * Float64(x + -1.0)) tmp = 0.0 if (Float64(1.0 - y) <= -50000.0) tmp = t_0; elseif (Float64(1.0 - y) <= 1.01) tmp = Float64(1.0 + Float64(y * x)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = y * (x + -1.0); tmp = 0.0; if ((1.0 - y) <= -50000.0) tmp = t_0; elseif ((1.0 - y) <= 1.01) tmp = 1.0 + (y * x); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(1.0 - y), $MachinePrecision], -50000.0], t$95$0, If[LessEqual[N[(1.0 - y), $MachinePrecision], 1.01], N[(1.0 + N[(y * x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(x + -1\right)\\
\mathbf{if}\;1 - y \leq -50000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;1 - y \leq 1.01:\\
\;\;\;\;1 + y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) y) < -5e4 or 1.01000000000000001 < (-.f64 #s(literal 1 binary64) y) Initial program 99.9%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6497.4%
Simplified97.4%
if -5e4 < (-.f64 #s(literal 1 binary64) y) < 1.01000000000000001Initial program 52.2%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified100.0%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6498.4%
Simplified98.4%
(FPCore (x y) :precision binary64 (if (<= x -5.1e-8) (* y (+ x -1.0)) (if (<= x 6.5e+18) (- 1.0 y) (* y x))))
double code(double x, double y) {
double tmp;
if (x <= -5.1e-8) {
tmp = y * (x + -1.0);
} else if (x <= 6.5e+18) {
tmp = 1.0 - y;
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-5.1d-8)) then
tmp = y * (x + (-1.0d0))
else if (x <= 6.5d+18) then
tmp = 1.0d0 - y
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -5.1e-8) {
tmp = y * (x + -1.0);
} else if (x <= 6.5e+18) {
tmp = 1.0 - y;
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -5.1e-8: tmp = y * (x + -1.0) elif x <= 6.5e+18: tmp = 1.0 - y else: tmp = y * x return tmp
function code(x, y) tmp = 0.0 if (x <= -5.1e-8) tmp = Float64(y * Float64(x + -1.0)); elseif (x <= 6.5e+18) tmp = Float64(1.0 - y); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -5.1e-8) tmp = y * (x + -1.0); elseif (x <= 6.5e+18) tmp = 1.0 - y; else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -5.1e-8], N[(y * N[(x + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.5e+18], N[(1.0 - y), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.1 \cdot 10^{-8}:\\
\;\;\;\;y \cdot \left(x + -1\right)\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{+18}:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if x < -5.10000000000000001e-8Initial program 57.1%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6482.9%
Simplified82.9%
if -5.10000000000000001e-8 < x < 6.5e18Initial program 98.6%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified100.0%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6498.1%
Simplified98.1%
if 6.5e18 < x Initial program 52.7%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified100.0%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6479.7%
Simplified79.7%
(FPCore (x y) :precision binary64 (if (<= x -52.0) (* y x) (if (<= x 4.4e+18) (- 1.0 y) (* y x))))
double code(double x, double y) {
double tmp;
if (x <= -52.0) {
tmp = y * x;
} else if (x <= 4.4e+18) {
tmp = 1.0 - y;
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-52.0d0)) then
tmp = y * x
else if (x <= 4.4d+18) then
tmp = 1.0d0 - y
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -52.0) {
tmp = y * x;
} else if (x <= 4.4e+18) {
tmp = 1.0 - y;
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -52.0: tmp = y * x elif x <= 4.4e+18: tmp = 1.0 - y else: tmp = y * x return tmp
function code(x, y) tmp = 0.0 if (x <= -52.0) tmp = Float64(y * x); elseif (x <= 4.4e+18) tmp = Float64(1.0 - y); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -52.0) tmp = y * x; elseif (x <= 4.4e+18) tmp = 1.0 - y; else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -52.0], N[(y * x), $MachinePrecision], If[LessEqual[x, 4.4e+18], N[(1.0 - y), $MachinePrecision], N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -52:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+18}:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if x < -52 or 4.4e18 < x Initial program 52.5%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified100.0%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6480.2%
Simplified80.2%
if -52 < x < 4.4e18Initial program 98.6%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified100.0%
Taylor expanded in x around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f6495.2%
Simplified95.2%
(FPCore (x y) :precision binary64 (if (<= x -5.1e-8) (* y x) (if (<= x 1.45e+22) 1.0 (* y x))))
double code(double x, double y) {
double tmp;
if (x <= -5.1e-8) {
tmp = y * x;
} else if (x <= 1.45e+22) {
tmp = 1.0;
} else {
tmp = y * x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-5.1d-8)) then
tmp = y * x
else if (x <= 1.45d+22) then
tmp = 1.0d0
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -5.1e-8) {
tmp = y * x;
} else if (x <= 1.45e+22) {
tmp = 1.0;
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -5.1e-8: tmp = y * x elif x <= 1.45e+22: tmp = 1.0 else: tmp = y * x return tmp
function code(x, y) tmp = 0.0 if (x <= -5.1e-8) tmp = Float64(y * x); elseif (x <= 1.45e+22) tmp = 1.0; else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -5.1e-8) tmp = y * x; elseif (x <= 1.45e+22) tmp = 1.0; else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -5.1e-8], N[(y * x), $MachinePrecision], If[LessEqual[x, 1.45e+22], 1.0, N[(y * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.1 \cdot 10^{-8}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+22}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if x < -5.10000000000000001e-8 or 1.45e22 < x Initial program 55.2%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified99.9%
Taylor expanded in x around inf
*-commutativeN/A
*-lowering-*.f6476.3%
Simplified76.3%
if -5.10000000000000001e-8 < x < 1.45e22Initial program 98.6%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified100.0%
Taylor expanded in y around 0
Simplified45.0%
(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 78.1%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified100.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 78.1%
sub-negN/A
distribute-rgt-inN/A
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
associate-+l+N/A
associate-+r+N/A
*-lft-identityN/A
neg-mul-1N/A
distribute-rgt1-inN/A
metadata-evalN/A
metadata-evalN/A
associate-*r*N/A
neg-mul-1N/A
*-lft-identityN/A
mul0-lftN/A
+-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
neg-mul-1N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified100.0%
Taylor expanded in y around 0
Simplified33.0%
(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 2024140
(FPCore (x y)
:name "Graphics.Rendering.Chart.Plot.Vectors:renderPlotVectors from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (- (* y x) (- y 1)))
(+ x (* (- 1.0 x) (- 1.0 y))))