
(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.2%
distribute-lft-out--97.2%
*-rgt-identity97.2%
cancel-sign-sub-inv97.2%
+-commutative97.2%
associate-+r+97.2%
+-commutative97.2%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
fma-udef100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (- z))))
(if (<= y -9.5e+242)
t_0
(if (<= y -6.3e+215)
(* y x)
(if (<= y -1.9e+150)
t_0
(if (<= y -9.8e+42)
(* y x)
(if (<= y -5.2e+14)
t_0
(if (or (<= y -1.45e-13)
(and (not (<= y -1.8e-100))
(or (<= y -1.7e-116) (not (<= y 6e-34)))))
(* y x)
z))))))))
double code(double x, double y, double z) {
double t_0 = y * -z;
double tmp;
if (y <= -9.5e+242) {
tmp = t_0;
} else if (y <= -6.3e+215) {
tmp = y * x;
} else if (y <= -1.9e+150) {
tmp = t_0;
} else if (y <= -9.8e+42) {
tmp = y * x;
} else if (y <= -5.2e+14) {
tmp = t_0;
} else if ((y <= -1.45e-13) || (!(y <= -1.8e-100) && ((y <= -1.7e-116) || !(y <= 6e-34)))) {
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) :: t_0
real(8) :: tmp
t_0 = y * -z
if (y <= (-9.5d+242)) then
tmp = t_0
else if (y <= (-6.3d+215)) then
tmp = y * x
else if (y <= (-1.9d+150)) then
tmp = t_0
else if (y <= (-9.8d+42)) then
tmp = y * x
else if (y <= (-5.2d+14)) then
tmp = t_0
else if ((y <= (-1.45d-13)) .or. (.not. (y <= (-1.8d-100))) .and. (y <= (-1.7d-116)) .or. (.not. (y <= 6d-34))) then
tmp = y * x
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * -z;
double tmp;
if (y <= -9.5e+242) {
tmp = t_0;
} else if (y <= -6.3e+215) {
tmp = y * x;
} else if (y <= -1.9e+150) {
tmp = t_0;
} else if (y <= -9.8e+42) {
tmp = y * x;
} else if (y <= -5.2e+14) {
tmp = t_0;
} else if ((y <= -1.45e-13) || (!(y <= -1.8e-100) && ((y <= -1.7e-116) || !(y <= 6e-34)))) {
tmp = y * x;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): t_0 = y * -z tmp = 0 if y <= -9.5e+242: tmp = t_0 elif y <= -6.3e+215: tmp = y * x elif y <= -1.9e+150: tmp = t_0 elif y <= -9.8e+42: tmp = y * x elif y <= -5.2e+14: tmp = t_0 elif (y <= -1.45e-13) or (not (y <= -1.8e-100) and ((y <= -1.7e-116) or not (y <= 6e-34))): tmp = y * x else: tmp = z return tmp
function code(x, y, z) t_0 = Float64(y * Float64(-z)) tmp = 0.0 if (y <= -9.5e+242) tmp = t_0; elseif (y <= -6.3e+215) tmp = Float64(y * x); elseif (y <= -1.9e+150) tmp = t_0; elseif (y <= -9.8e+42) tmp = Float64(y * x); elseif (y <= -5.2e+14) tmp = t_0; elseif ((y <= -1.45e-13) || (!(y <= -1.8e-100) && ((y <= -1.7e-116) || !(y <= 6e-34)))) tmp = Float64(y * x); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * -z; tmp = 0.0; if (y <= -9.5e+242) tmp = t_0; elseif (y <= -6.3e+215) tmp = y * x; elseif (y <= -1.9e+150) tmp = t_0; elseif (y <= -9.8e+42) tmp = y * x; elseif (y <= -5.2e+14) tmp = t_0; elseif ((y <= -1.45e-13) || (~((y <= -1.8e-100)) && ((y <= -1.7e-116) || ~((y <= 6e-34))))) tmp = y * x; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * (-z)), $MachinePrecision]}, If[LessEqual[y, -9.5e+242], t$95$0, If[LessEqual[y, -6.3e+215], N[(y * x), $MachinePrecision], If[LessEqual[y, -1.9e+150], t$95$0, If[LessEqual[y, -9.8e+42], N[(y * x), $MachinePrecision], If[LessEqual[y, -5.2e+14], t$95$0, If[Or[LessEqual[y, -1.45e-13], And[N[Not[LessEqual[y, -1.8e-100]], $MachinePrecision], Or[LessEqual[y, -1.7e-116], N[Not[LessEqual[y, 6e-34]], $MachinePrecision]]]], N[(y * x), $MachinePrecision], z]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(-z\right)\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{+242}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -6.3 \cdot 10^{+215}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq -1.9 \cdot 10^{+150}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -9.8 \cdot 10^{+42}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{+14}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.45 \cdot 10^{-13} \lor \neg \left(y \leq -1.8 \cdot 10^{-100}\right) \land \left(y \leq -1.7 \cdot 10^{-116} \lor \neg \left(y \leq 6 \cdot 10^{-34}\right)\right):\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if y < -9.49999999999999995e242 or -6.2999999999999997e215 < y < -1.89999999999999995e150 or -9.8000000000000004e42 < y < -5.2e14Initial program 86.1%
Taylor expanded in x around 0 82.1%
Taylor expanded in y around inf 82.1%
mul-1-neg82.1%
distribute-lft-neg-out82.1%
*-commutative82.1%
Simplified82.1%
if -9.49999999999999995e242 < y < -6.2999999999999997e215 or -1.89999999999999995e150 < y < -9.8000000000000004e42 or -5.2e14 < y < -1.4499999999999999e-13 or -1.7999999999999999e-100 < y < -1.69999999999999996e-116 or 6e-34 < y Initial program 97.2%
Taylor expanded in x around inf 68.1%
*-commutative68.1%
Simplified68.1%
if -1.4499999999999999e-13 < y < -1.7999999999999999e-100 or -1.69999999999999996e-116 < y < 6e-34Initial program 100.0%
Taylor expanded in y around 0 78.7%
Final simplification74.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (- x z))))
(if (<= y -6.4e-18)
t_0
(if (<= y -1.6e-100)
z
(if (<= y -2.8e-116) (* y x) (if (<= y 1.18e-23) z t_0))))))
double code(double x, double y, double z) {
double t_0 = y * (x - z);
double tmp;
if (y <= -6.4e-18) {
tmp = t_0;
} else if (y <= -1.6e-100) {
tmp = z;
} else if (y <= -2.8e-116) {
tmp = y * x;
} else if (y <= 1.18e-23) {
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 <= (-6.4d-18)) then
tmp = t_0
else if (y <= (-1.6d-100)) then
tmp = z
else if (y <= (-2.8d-116)) then
tmp = y * x
else if (y <= 1.18d-23) 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 <= -6.4e-18) {
tmp = t_0;
} else if (y <= -1.6e-100) {
tmp = z;
} else if (y <= -2.8e-116) {
tmp = y * x;
} else if (y <= 1.18e-23) {
tmp = z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x - z) tmp = 0 if y <= -6.4e-18: tmp = t_0 elif y <= -1.6e-100: tmp = z elif y <= -2.8e-116: tmp = y * x elif y <= 1.18e-23: 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 <= -6.4e-18) tmp = t_0; elseif (y <= -1.6e-100) tmp = z; elseif (y <= -2.8e-116) tmp = Float64(y * x); elseif (y <= 1.18e-23) 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 <= -6.4e-18) tmp = t_0; elseif (y <= -1.6e-100) tmp = z; elseif (y <= -2.8e-116) tmp = y * x; elseif (y <= 1.18e-23) 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, -6.4e-18], t$95$0, If[LessEqual[y, -1.6e-100], z, If[LessEqual[y, -2.8e-116], N[(y * x), $MachinePrecision], If[LessEqual[y, 1.18e-23], z, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(x - z\right)\\
\mathbf{if}\;y \leq -6.4 \cdot 10^{-18}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.6 \cdot 10^{-100}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-116}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq 1.18 \cdot 10^{-23}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -6.3999999999999998e-18 or 1.18e-23 < y Initial program 94.6%
Taylor expanded in y around inf 94.8%
neg-mul-194.8%
sub-neg94.8%
Simplified94.8%
if -6.3999999999999998e-18 < y < -1.60000000000000008e-100 or -2.7999999999999999e-116 < y < 1.18e-23Initial program 100.0%
Taylor expanded in y around 0 78.2%
if -1.60000000000000008e-100 < y < -2.7999999999999999e-116Initial 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))) (t_1 (* z (- 1.0 y))))
(if (<= y -0.000112)
t_0
(if (<= y -7.3e-100)
t_1
(if (<= y -2.8e-116) (* y x) (if (<= y 2.2e-11) t_1 t_0))))))
double code(double x, double y, double z) {
double t_0 = y * (x - z);
double t_1 = z * (1.0 - y);
double tmp;
if (y <= -0.000112) {
tmp = t_0;
} else if (y <= -7.3e-100) {
tmp = t_1;
} else if (y <= -2.8e-116) {
tmp = y * x;
} else if (y <= 2.2e-11) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = y * (x - z)
t_1 = z * (1.0d0 - y)
if (y <= (-0.000112d0)) then
tmp = t_0
else if (y <= (-7.3d-100)) then
tmp = t_1
else if (y <= (-2.8d-116)) then
tmp = y * x
else if (y <= 2.2d-11) then
tmp = t_1
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 t_1 = z * (1.0 - y);
double tmp;
if (y <= -0.000112) {
tmp = t_0;
} else if (y <= -7.3e-100) {
tmp = t_1;
} else if (y <= -2.8e-116) {
tmp = y * x;
} else if (y <= 2.2e-11) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x - z) t_1 = z * (1.0 - y) tmp = 0 if y <= -0.000112: tmp = t_0 elif y <= -7.3e-100: tmp = t_1 elif y <= -2.8e-116: tmp = y * x elif y <= 2.2e-11: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x - z)) t_1 = Float64(z * Float64(1.0 - y)) tmp = 0.0 if (y <= -0.000112) tmp = t_0; elseif (y <= -7.3e-100) tmp = t_1; elseif (y <= -2.8e-116) tmp = Float64(y * x); elseif (y <= 2.2e-11) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x - z); t_1 = z * (1.0 - y); tmp = 0.0; if (y <= -0.000112) tmp = t_0; elseif (y <= -7.3e-100) tmp = t_1; elseif (y <= -2.8e-116) tmp = y * x; elseif (y <= 2.2e-11) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -0.000112], t$95$0, If[LessEqual[y, -7.3e-100], t$95$1, If[LessEqual[y, -2.8e-116], N[(y * x), $MachinePrecision], If[LessEqual[y, 2.2e-11], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(x - z\right)\\
t_1 := z \cdot \left(1 - y\right)\\
\mathbf{if}\;y \leq -0.000112:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -7.3 \cdot 10^{-100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-116}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -1.11999999999999998e-4 or 2.2000000000000002e-11 < y Initial program 94.2%
Taylor expanded in y around inf 98.2%
neg-mul-198.2%
sub-neg98.2%
Simplified98.2%
if -1.11999999999999998e-4 < y < -7.2999999999999995e-100 or -2.7999999999999999e-116 < y < 2.2000000000000002e-11Initial program 100.0%
Taylor expanded in x around 0 76.7%
if -7.2999999999999995e-100 < y < -2.7999999999999999e-116Initial program 100.0%
Taylor expanded in x around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification87.3%
(FPCore (x y z)
:precision binary64
(if (or (<= y -1.65e-13)
(not
(or (<= y -1.6e-100) (and (not (<= y -2.35e-116)) (<= y 1.5e-33)))))
(* y x)
z))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.65e-13) || !((y <= -1.6e-100) || (!(y <= -2.35e-116) && (y <= 1.5e-33)))) {
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 <= (-1.65d-13)) .or. (.not. (y <= (-1.6d-100)) .or. (.not. (y <= (-2.35d-116))) .and. (y <= 1.5d-33))) 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 <= -1.65e-13) || !((y <= -1.6e-100) || (!(y <= -2.35e-116) && (y <= 1.5e-33)))) {
tmp = y * x;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.65e-13) or not ((y <= -1.6e-100) or (not (y <= -2.35e-116) and (y <= 1.5e-33))): tmp = y * x else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.65e-13) || !((y <= -1.6e-100) || (!(y <= -2.35e-116) && (y <= 1.5e-33)))) tmp = Float64(y * x); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.65e-13) || ~(((y <= -1.6e-100) || (~((y <= -2.35e-116)) && (y <= 1.5e-33))))) tmp = y * x; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.65e-13], N[Not[Or[LessEqual[y, -1.6e-100], And[N[Not[LessEqual[y, -2.35e-116]], $MachinePrecision], LessEqual[y, 1.5e-33]]]], $MachinePrecision]], N[(y * x), $MachinePrecision], z]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{-13} \lor \neg \left(y \leq -1.6 \cdot 10^{-100} \lor \neg \left(y \leq -2.35 \cdot 10^{-116}\right) \land y \leq 1.5 \cdot 10^{-33}\right):\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if y < -1.65e-13 or -1.60000000000000008e-100 < y < -2.34999999999999997e-116 or 1.5000000000000001e-33 < y Initial program 94.8%
Taylor expanded in x around inf 58.9%
*-commutative58.9%
Simplified58.9%
if -1.65e-13 < y < -1.60000000000000008e-100 or -2.34999999999999997e-116 < y < 1.5000000000000001e-33Initial program 100.0%
Taylor expanded in y around 0 78.7%
Final simplification68.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.0) (not (<= y 5e-9))) (* y (- x z)) (+ z (* y x))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.0) || !(y <= 5e-9)) {
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 <= 5d-9))) 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 <= 5e-9)) {
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 <= 5e-9): tmp = y * (x - z) else: tmp = z + (y * x) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.0) || !(y <= 5e-9)) 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 <= 5e-9))) 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, 5e-9]], $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 5 \cdot 10^{-9}\right):\\
\;\;\;\;y \cdot \left(x - z\right)\\
\mathbf{else}:\\
\;\;\;\;z + y \cdot x\\
\end{array}
\end{array}
if y < -1 or 5.0000000000000001e-9 < y Initial program 94.1%
Taylor expanded in y around inf 98.1%
neg-mul-198.1%
sub-neg98.1%
Simplified98.1%
if -1 < y < 5.0000000000000001e-9Initial program 100.0%
distribute-lft-out--100.0%
*-rgt-identity100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
distribute-rgt-out100.0%
fma-def100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
fma-udef100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 98.9%
*-commutative98.9%
Simplified98.9%
Final simplification98.5%
(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.2%
Taylor expanded in y around 0 39.9%
Final simplification39.9%
(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 2024024
(FPCore (x y z)
:name "Diagrams.TwoD.Segment:bezierClip from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(- z (* (- z x) y))
(+ (* x y) (* z (- 1.0 y))))