
(FPCore (x y z) :precision binary64 (+ (* x y) (* z (- 1.0 y))))
double code(double x, double y, double z) {
return (x * y) + (z * (1.0 - y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) + (z * (1.0d0 - y))
end function
public static double code(double x, double y, double z) {
return (x * y) + (z * (1.0 - y));
}
def code(x, y, z): return (x * y) + (z * (1.0 - y))
function code(x, y, z) return Float64(Float64(x * y) + Float64(z * Float64(1.0 - y))) end
function tmp = code(x, y, z) tmp = (x * y) + (z * (1.0 - y)); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot y + z \cdot \left(1 - y\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (* x y) (* z (- 1.0 y))))
double code(double x, double y, double z) {
return (x * y) + (z * (1.0 - y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) + (z * (1.0d0 - y))
end function
public static double code(double x, double y, double z) {
return (x * y) + (z * (1.0 - y));
}
def code(x, y, z): return (x * y) + (z * (1.0 - y))
function code(x, y, z) return Float64(Float64(x * y) + Float64(z * Float64(1.0 - y))) end
function tmp = code(x, y, z) tmp = (x * y) + (z * (1.0 - y)); end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot y + z \cdot \left(1 - y\right)
\end{array}
(FPCore (x y z) :precision binary64 (+ z (* y (- x z))))
double code(double x, double y, double z) {
return z + (y * (x - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = z + (y * (x - z))
end function
public static double code(double x, double y, double z) {
return z + (y * (x - z));
}
def code(x, y, z): return z + (y * (x - z))
function code(x, y, z) return Float64(z + Float64(y * Float64(x - z))) end
function tmp = code(x, y, z) tmp = z + (y * (x - z)); end
code[x_, y_, z_] := N[(z + N[(y * N[(x - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z + y \cdot \left(x - z\right)
\end{array}
Initial program 97.7%
+-commutative97.7%
+-lft-identity97.7%
cancel-sign-sub97.7%
cancel-sign-sub97.7%
+-lft-identity97.7%
distribute-lft-out--97.6%
*-rgt-identity97.6%
associate-+l-97.6%
distribute-rgt-out--100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- y))))
(if (<= y -3.2e+58)
t_0
(if (<= y -4.5e+50)
(* y x)
(if (<= y -1.0)
t_0
(if (<= y -2.2e-96)
z
(if (<= y -3.5e-102)
(* y x)
(if (<= y 9.5e-20)
z
(if (or (<= y 6.8e+84) (not (<= y 2.4e+128)))
(* y x)
t_0)))))))))
double code(double x, double y, double z) {
double t_0 = z * -y;
double tmp;
if (y <= -3.2e+58) {
tmp = t_0;
} else if (y <= -4.5e+50) {
tmp = y * x;
} else if (y <= -1.0) {
tmp = t_0;
} else if (y <= -2.2e-96) {
tmp = z;
} else if (y <= -3.5e-102) {
tmp = y * x;
} else if (y <= 9.5e-20) {
tmp = z;
} else if ((y <= 6.8e+84) || !(y <= 2.4e+128)) {
tmp = y * x;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * -y
if (y <= (-3.2d+58)) then
tmp = t_0
else if (y <= (-4.5d+50)) then
tmp = y * x
else if (y <= (-1.0d0)) then
tmp = t_0
else if (y <= (-2.2d-96)) then
tmp = z
else if (y <= (-3.5d-102)) then
tmp = y * x
else if (y <= 9.5d-20) then
tmp = z
else if ((y <= 6.8d+84) .or. (.not. (y <= 2.4d+128))) then
tmp = y * x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * -y;
double tmp;
if (y <= -3.2e+58) {
tmp = t_0;
} else if (y <= -4.5e+50) {
tmp = y * x;
} else if (y <= -1.0) {
tmp = t_0;
} else if (y <= -2.2e-96) {
tmp = z;
} else if (y <= -3.5e-102) {
tmp = y * x;
} else if (y <= 9.5e-20) {
tmp = z;
} else if ((y <= 6.8e+84) || !(y <= 2.4e+128)) {
tmp = y * x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * -y tmp = 0 if y <= -3.2e+58: tmp = t_0 elif y <= -4.5e+50: tmp = y * x elif y <= -1.0: tmp = t_0 elif y <= -2.2e-96: tmp = z elif y <= -3.5e-102: tmp = y * x elif y <= 9.5e-20: tmp = z elif (y <= 6.8e+84) or not (y <= 2.4e+128): tmp = y * x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-y)) tmp = 0.0 if (y <= -3.2e+58) tmp = t_0; elseif (y <= -4.5e+50) tmp = Float64(y * x); elseif (y <= -1.0) tmp = t_0; elseif (y <= -2.2e-96) tmp = z; elseif (y <= -3.5e-102) tmp = Float64(y * x); elseif (y <= 9.5e-20) tmp = z; elseif ((y <= 6.8e+84) || !(y <= 2.4e+128)) tmp = Float64(y * x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * -y; tmp = 0.0; if (y <= -3.2e+58) tmp = t_0; elseif (y <= -4.5e+50) tmp = y * x; elseif (y <= -1.0) tmp = t_0; elseif (y <= -2.2e-96) tmp = z; elseif (y <= -3.5e-102) tmp = y * x; elseif (y <= 9.5e-20) tmp = z; elseif ((y <= 6.8e+84) || ~((y <= 2.4e+128))) tmp = y * x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * (-y)), $MachinePrecision]}, If[LessEqual[y, -3.2e+58], t$95$0, If[LessEqual[y, -4.5e+50], N[(y * x), $MachinePrecision], If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, -2.2e-96], z, If[LessEqual[y, -3.5e-102], N[(y * x), $MachinePrecision], If[LessEqual[y, 9.5e-20], z, If[Or[LessEqual[y, 6.8e+84], N[Not[LessEqual[y, 2.4e+128]], $MachinePrecision]], N[(y * x), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(-y\right)\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+58}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{+50}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -2.2 \cdot 10^{-96}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-102}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{-20}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+84} \lor \neg \left(y \leq 2.4 \cdot 10^{+128}\right):\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -3.20000000000000015e58 or -4.50000000000000014e50 < y < -1 or 6.7999999999999996e84 < y < 2.4000000000000002e128Initial program 95.9%
Taylor expanded in y around inf 99.3%
mul-1-neg99.3%
sub-neg99.3%
Simplified99.3%
Taylor expanded in x around 0 67.8%
mul-1-neg67.8%
distribute-rgt-neg-out67.8%
Simplified67.8%
if -3.20000000000000015e58 < y < -4.50000000000000014e50 or -2.19999999999999979e-96 < y < -3.49999999999999986e-102 or 9.5e-20 < y < 6.7999999999999996e84 or 2.4000000000000002e128 < y Initial program 95.8%
Taylor expanded in x around inf 69.0%
*-commutative69.0%
Simplified69.0%
if -1 < y < -2.19999999999999979e-96 or -3.49999999999999986e-102 < y < 9.5e-20Initial program 100.0%
Taylor expanded in y around 0 71.9%
Final simplification69.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (- x z))))
(if (<= y -9.5e-43)
t_0
(if (<= y -2.8e-96)
z
(if (<= y -2.2e-103) (* y x) (if (<= y 7.8e-19) z t_0))))))
double code(double x, double y, double z) {
double t_0 = y * (x - z);
double tmp;
if (y <= -9.5e-43) {
tmp = t_0;
} else if (y <= -2.8e-96) {
tmp = z;
} else if (y <= -2.2e-103) {
tmp = y * x;
} else if (y <= 7.8e-19) {
tmp = z;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = y * (x - z)
if (y <= (-9.5d-43)) then
tmp = t_0
else if (y <= (-2.8d-96)) then
tmp = z
else if (y <= (-2.2d-103)) then
tmp = y * x
else if (y <= 7.8d-19) then
tmp = z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x - z);
double tmp;
if (y <= -9.5e-43) {
tmp = t_0;
} else if (y <= -2.8e-96) {
tmp = z;
} else if (y <= -2.2e-103) {
tmp = y * x;
} else if (y <= 7.8e-19) {
tmp = z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x - z) tmp = 0 if y <= -9.5e-43: tmp = t_0 elif y <= -2.8e-96: tmp = z elif y <= -2.2e-103: tmp = y * x elif y <= 7.8e-19: tmp = z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x - z)) tmp = 0.0 if (y <= -9.5e-43) tmp = t_0; elseif (y <= -2.8e-96) tmp = z; elseif (y <= -2.2e-103) tmp = Float64(y * x); elseif (y <= 7.8e-19) tmp = z; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x - z); tmp = 0.0; if (y <= -9.5e-43) tmp = t_0; elseif (y <= -2.8e-96) tmp = z; elseif (y <= -2.2e-103) tmp = y * x; elseif (y <= 7.8e-19) tmp = z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.5e-43], t$95$0, If[LessEqual[y, -2.8e-96], z, If[LessEqual[y, -2.2e-103], N[(y * x), $MachinePrecision], If[LessEqual[y, 7.8e-19], z, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(x - z\right)\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{-43}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-96}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq -2.2 \cdot 10^{-103}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{-19}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -9.50000000000000044e-43 or 7.7999999999999999e-19 < y Initial program 95.8%
Taylor expanded in y around inf 97.4%
mul-1-neg97.4%
sub-neg97.4%
Simplified97.4%
if -9.50000000000000044e-43 < y < -2.80000000000000015e-96 or -2.1999999999999999e-103 < y < 7.7999999999999999e-19Initial program 100.0%
Taylor expanded in y around 0 72.7%
if -2.80000000000000015e-96 < y < -2.1999999999999999e-103Initial program 100.0%
Taylor expanded in x around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification87.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (- x z))))
(if (<= y -4.3e+33)
t_0
(if (<= y -2.2e-96)
(* z (- 1.0 y))
(if (<= y -3.5e-102) (* y x) (if (<= y 1.5e-19) z t_0))))))
double code(double x, double y, double z) {
double t_0 = y * (x - z);
double tmp;
if (y <= -4.3e+33) {
tmp = t_0;
} else if (y <= -2.2e-96) {
tmp = z * (1.0 - y);
} else if (y <= -3.5e-102) {
tmp = y * x;
} else if (y <= 1.5e-19) {
tmp = z;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = y * (x - z)
if (y <= (-4.3d+33)) then
tmp = t_0
else if (y <= (-2.2d-96)) then
tmp = z * (1.0d0 - y)
else if (y <= (-3.5d-102)) then
tmp = y * x
else if (y <= 1.5d-19) then
tmp = z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x - z);
double tmp;
if (y <= -4.3e+33) {
tmp = t_0;
} else if (y <= -2.2e-96) {
tmp = z * (1.0 - y);
} else if (y <= -3.5e-102) {
tmp = y * x;
} else if (y <= 1.5e-19) {
tmp = z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x - z) tmp = 0 if y <= -4.3e+33: tmp = t_0 elif y <= -2.2e-96: tmp = z * (1.0 - y) elif y <= -3.5e-102: tmp = y * x elif y <= 1.5e-19: tmp = z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x - z)) tmp = 0.0 if (y <= -4.3e+33) tmp = t_0; elseif (y <= -2.2e-96) tmp = Float64(z * Float64(1.0 - y)); elseif (y <= -3.5e-102) tmp = Float64(y * x); elseif (y <= 1.5e-19) tmp = z; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x - z); tmp = 0.0; if (y <= -4.3e+33) tmp = t_0; elseif (y <= -2.2e-96) tmp = z * (1.0 - y); elseif (y <= -3.5e-102) tmp = y * x; elseif (y <= 1.5e-19) tmp = z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.3e+33], t$95$0, If[LessEqual[y, -2.2e-96], N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.5e-102], N[(y * x), $MachinePrecision], If[LessEqual[y, 1.5e-19], z, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(x - z\right)\\
\mathbf{if}\;y \leq -4.3 \cdot 10^{+33}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -2.2 \cdot 10^{-96}:\\
\;\;\;\;z \cdot \left(1 - y\right)\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{-102}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-19}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -4.30000000000000028e33 or 1.49999999999999996e-19 < y Initial program 95.5%
Taylor expanded in y around inf 99.0%
mul-1-neg99.0%
sub-neg99.0%
Simplified99.0%
if -4.30000000000000028e33 < y < -2.19999999999999979e-96Initial program 100.0%
Taylor expanded in x around 0 75.8%
if -2.19999999999999979e-96 < y < -3.49999999999999986e-102Initial program 100.0%
Taylor expanded in x around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -3.49999999999999986e-102 < y < 1.49999999999999996e-19Initial program 100.0%
Taylor expanded in y around 0 72.3%
Final simplification87.2%
(FPCore (x y z)
:precision binary64
(if (or (<= y -4.3e+33)
(not
(or (<= y -2.9e-96) (and (not (<= y -3.5e-102)) (<= y 1.25e-18)))))
(* y x)
z))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.3e+33) || !((y <= -2.9e-96) || (!(y <= -3.5e-102) && (y <= 1.25e-18)))) {
tmp = y * x;
} else {
tmp = z;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-4.3d+33)) .or. (.not. (y <= (-2.9d-96)) .or. (.not. (y <= (-3.5d-102))) .and. (y <= 1.25d-18))) then
tmp = y * x
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4.3e+33) || !((y <= -2.9e-96) || (!(y <= -3.5e-102) && (y <= 1.25e-18)))) {
tmp = y * x;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.3e+33) or not ((y <= -2.9e-96) or (not (y <= -3.5e-102) and (y <= 1.25e-18))): tmp = y * x else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.3e+33) || !((y <= -2.9e-96) || (!(y <= -3.5e-102) && (y <= 1.25e-18)))) tmp = Float64(y * x); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4.3e+33) || ~(((y <= -2.9e-96) || (~((y <= -3.5e-102)) && (y <= 1.25e-18))))) tmp = y * x; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.3e+33], N[Not[Or[LessEqual[y, -2.9e-96], And[N[Not[LessEqual[y, -3.5e-102]], $MachinePrecision], LessEqual[y, 1.25e-18]]]], $MachinePrecision]], N[(y * x), $MachinePrecision], z]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{+33} \lor \neg \left(y \leq -2.9 \cdot 10^{-96} \lor \neg \left(y \leq -3.5 \cdot 10^{-102}\right) \land y \leq 1.25 \cdot 10^{-18}\right):\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if y < -4.30000000000000028e33 or -2.89999999999999994e-96 < y < -3.49999999999999986e-102 or 1.25000000000000009e-18 < y Initial program 95.7%
Taylor expanded in x around inf 53.6%
*-commutative53.6%
Simplified53.6%
if -4.30000000000000028e33 < y < -2.89999999999999994e-96 or -3.49999999999999986e-102 < y < 1.25000000000000009e-18Initial program 100.0%
Taylor expanded in y around 0 69.8%
Final simplification61.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.0) (not (<= y 2.2e-18))) (* y (- x z)) (+ z (* y x))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 2.2e-18)) {
tmp = y * (x - z);
} else {
tmp = z + (y * x);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.0d0)) .or. (.not. (y <= 2.2d-18))) then
tmp = y * (x - z)
else
tmp = z + (y * x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 2.2e-18)) {
tmp = y * (x - z);
} else {
tmp = z + (y * x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.0) or not (y <= 2.2e-18): tmp = y * (x - z) else: tmp = z + (y * x) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.0) || !(y <= 2.2e-18)) tmp = Float64(y * Float64(x - z)); else tmp = Float64(z + Float64(y * x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.0) || ~((y <= 2.2e-18))) tmp = y * (x - z); else tmp = z + (y * x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 2.2e-18]], $MachinePrecision]], N[(y * N[(x - z), $MachinePrecision]), $MachinePrecision], N[(z + N[(y * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 2.2 \cdot 10^{-18}\right):\\
\;\;\;\;y \cdot \left(x - z\right)\\
\mathbf{else}:\\
\;\;\;\;z + y \cdot x\\
\end{array}
\end{array}
if y < -1 or 2.1999999999999998e-18 < y Initial program 95.7%
Taylor expanded in y around inf 98.7%
mul-1-neg98.7%
sub-neg98.7%
Simplified98.7%
if -1 < y < 2.1999999999999998e-18Initial program 100.0%
+-commutative100.0%
+-lft-identity100.0%
cancel-sign-sub100.0%
cancel-sign-sub100.0%
+-lft-identity100.0%
distribute-lft-out--100.0%
*-rgt-identity100.0%
associate-+l-100.0%
distribute-rgt-out--100.0%
Simplified100.0%
Taylor expanded in z around 0 100.0%
mul-1-neg100.0%
distribute-lft-neg-out100.0%
*-commutative100.0%
Simplified100.0%
Final simplification99.3%
(FPCore (x y z) :precision binary64 z)
double code(double x, double y, double z) {
return z;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = z
end function
public static double code(double x, double y, double z) {
return z;
}
def code(x, y, z): return z
function code(x, y, z) return z end
function tmp = code(x, y, z) tmp = z; end
code[x_, y_, z_] := z
\begin{array}{l}
\\
z
\end{array}
Initial program 97.7%
Taylor expanded in y around 0 33.2%
Final simplification33.2%
(FPCore (x y z) :precision binary64 (- z (* (- z x) y)))
double code(double x, double y, double z) {
return z - ((z - x) * y);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = z - ((z - x) * y)
end function
public static double code(double x, double y, double z) {
return z - ((z - x) * y);
}
def code(x, y, z): return z - ((z - x) * y)
function code(x, y, z) return Float64(z - Float64(Float64(z - x) * y)) end
function tmp = code(x, y, z) tmp = z - ((z - x) * y); end
code[x_, y_, z_] := N[(z - N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z - \left(z - x\right) \cdot y
\end{array}
herbie shell --seed 2024077
(FPCore (x y z)
:name "Diagrams.TwoD.Segment:bezierClip from diagrams-lib-1.3.0.3"
:precision binary64
:alt
(- z (* (- z x) y))
(+ (* x y) (* z (- 1.0 y))))