
(FPCore (x y z) :precision binary64 (+ (* (- 1.0 x) y) (* x z)))
double code(double x, double y, double z) {
return ((1.0 - x) * 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 = ((1.0d0 - x) * y) + (x * z)
end function
public static double code(double x, double y, double z) {
return ((1.0 - x) * y) + (x * z);
}
def code(x, y, z): return ((1.0 - x) * y) + (x * z)
function code(x, y, z) return Float64(Float64(Float64(1.0 - x) * y) + Float64(x * z)) end
function tmp = code(x, y, z) tmp = ((1.0 - x) * y) + (x * z); end
code[x_, y_, z_] := N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) \cdot y + x \cdot z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (* (- 1.0 x) y) (* x z)))
double code(double x, double y, double z) {
return ((1.0 - x) * 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 = ((1.0d0 - x) * y) + (x * z)
end function
public static double code(double x, double y, double z) {
return ((1.0 - x) * y) + (x * z);
}
def code(x, y, z): return ((1.0 - x) * y) + (x * z)
function code(x, y, z) return Float64(Float64(Float64(1.0 - x) * y) + Float64(x * z)) end
function tmp = code(x, y, z) tmp = ((1.0 - x) * y) + (x * z); end
code[x_, y_, z_] := N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(1 - x\right) \cdot y + x \cdot z
\end{array}
(FPCore (x y z) :precision binary64 (+ y (* x (- z y))))
double code(double x, double y, double z) {
return y + (x * (z - y));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y + (x * (z - y))
end function
public static double code(double x, double y, double z) {
return y + (x * (z - y));
}
def code(x, y, z): return y + (x * (z - y))
function code(x, y, z) return Float64(y + Float64(x * Float64(z - y))) end
function tmp = code(x, y, z) tmp = y + (x * (z - y)); end
code[x_, y_, z_] := N[(y + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y + x \cdot \left(z - y\right)
\end{array}
Initial program 96.5%
remove-double-neg96.5%
distribute-rgt-neg-out96.5%
neg-sub096.5%
neg-sub096.5%
*-commutative96.5%
distribute-lft-neg-in96.5%
remove-double-neg96.5%
distribute-rgt-out--96.5%
*-lft-identity96.5%
associate-+l-96.5%
distribute-lft-out--100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (- x))))
(if (<= x -4.7e+282)
(* x z)
(if (<= x -4.8e+219)
t_0
(if (<= x -2.8e+192)
(* x z)
(if (<= x -4e+122)
t_0
(if (<= x -7.5e+84)
(* x z)
(if (<= x -600.0)
t_0
(if (<= x 5.7e-24) y (if (<= x 5e+66) (* x z) t_0))))))))))
double code(double x, double y, double z) {
double t_0 = y * -x;
double tmp;
if (x <= -4.7e+282) {
tmp = x * z;
} else if (x <= -4.8e+219) {
tmp = t_0;
} else if (x <= -2.8e+192) {
tmp = x * z;
} else if (x <= -4e+122) {
tmp = t_0;
} else if (x <= -7.5e+84) {
tmp = x * z;
} else if (x <= -600.0) {
tmp = t_0;
} else if (x <= 5.7e-24) {
tmp = y;
} else if (x <= 5e+66) {
tmp = x * 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
if (x <= (-4.7d+282)) then
tmp = x * z
else if (x <= (-4.8d+219)) then
tmp = t_0
else if (x <= (-2.8d+192)) then
tmp = x * z
else if (x <= (-4d+122)) then
tmp = t_0
else if (x <= (-7.5d+84)) then
tmp = x * z
else if (x <= (-600.0d0)) then
tmp = t_0
else if (x <= 5.7d-24) then
tmp = y
else if (x <= 5d+66) then
tmp = x * 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;
double tmp;
if (x <= -4.7e+282) {
tmp = x * z;
} else if (x <= -4.8e+219) {
tmp = t_0;
} else if (x <= -2.8e+192) {
tmp = x * z;
} else if (x <= -4e+122) {
tmp = t_0;
} else if (x <= -7.5e+84) {
tmp = x * z;
} else if (x <= -600.0) {
tmp = t_0;
} else if (x <= 5.7e-24) {
tmp = y;
} else if (x <= 5e+66) {
tmp = x * z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * -x tmp = 0 if x <= -4.7e+282: tmp = x * z elif x <= -4.8e+219: tmp = t_0 elif x <= -2.8e+192: tmp = x * z elif x <= -4e+122: tmp = t_0 elif x <= -7.5e+84: tmp = x * z elif x <= -600.0: tmp = t_0 elif x <= 5.7e-24: tmp = y elif x <= 5e+66: tmp = x * z else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(-x)) tmp = 0.0 if (x <= -4.7e+282) tmp = Float64(x * z); elseif (x <= -4.8e+219) tmp = t_0; elseif (x <= -2.8e+192) tmp = Float64(x * z); elseif (x <= -4e+122) tmp = t_0; elseif (x <= -7.5e+84) tmp = Float64(x * z); elseif (x <= -600.0) tmp = t_0; elseif (x <= 5.7e-24) tmp = y; elseif (x <= 5e+66) tmp = Float64(x * z); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * -x; tmp = 0.0; if (x <= -4.7e+282) tmp = x * z; elseif (x <= -4.8e+219) tmp = t_0; elseif (x <= -2.8e+192) tmp = x * z; elseif (x <= -4e+122) tmp = t_0; elseif (x <= -7.5e+84) tmp = x * z; elseif (x <= -600.0) tmp = t_0; elseif (x <= 5.7e-24) tmp = y; elseif (x <= 5e+66) tmp = x * z; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[x, -4.7e+282], N[(x * z), $MachinePrecision], If[LessEqual[x, -4.8e+219], t$95$0, If[LessEqual[x, -2.8e+192], N[(x * z), $MachinePrecision], If[LessEqual[x, -4e+122], t$95$0, If[LessEqual[x, -7.5e+84], N[(x * z), $MachinePrecision], If[LessEqual[x, -600.0], t$95$0, If[LessEqual[x, 5.7e-24], y, If[LessEqual[x, 5e+66], N[(x * z), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(-x\right)\\
\mathbf{if}\;x \leq -4.7 \cdot 10^{+282}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{+219}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{+192}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq -4 \cdot 10^{+122}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -7.5 \cdot 10^{+84}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;x \leq -600:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.7 \cdot 10^{-24}:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+66}:\\
\;\;\;\;x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -4.70000000000000035e282 or -4.8000000000000001e219 < x < -2.79999999999999976e192 or -4.00000000000000006e122 < x < -7.5000000000000001e84 or 5.70000000000000002e-24 < x < 4.99999999999999991e66Initial program 97.5%
Taylor expanded in y around 0 86.5%
if -4.70000000000000035e282 < x < -4.8000000000000001e219 or -2.79999999999999976e192 < x < -4.00000000000000006e122 or -7.5000000000000001e84 < x < -600 or 4.99999999999999991e66 < x Initial program 90.7%
Taylor expanded in x around inf 99.7%
mul-1-neg99.7%
sub-neg99.7%
Simplified99.7%
Taylor expanded in z around 0 71.9%
mul-1-neg71.9%
distribute-rgt-neg-out71.9%
Simplified71.9%
if -600 < x < 5.70000000000000002e-24Initial program 100.0%
Taylor expanded in x around 0 72.6%
Final simplification74.5%
(FPCore (x y z)
:precision binary64
(if (or (<= x -3.7e-19)
(and (not (<= x -6.2e-145))
(or (<= x -5.8e-187) (not (<= x 5.8e-24)))))
(* x (- z y))
y))
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.7e-19) || (!(x <= -6.2e-145) && ((x <= -5.8e-187) || !(x <= 5.8e-24)))) {
tmp = x * (z - y);
} else {
tmp = y;
}
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 ((x <= (-3.7d-19)) .or. (.not. (x <= (-6.2d-145))) .and. (x <= (-5.8d-187)) .or. (.not. (x <= 5.8d-24))) then
tmp = x * (z - y)
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -3.7e-19) || (!(x <= -6.2e-145) && ((x <= -5.8e-187) || !(x <= 5.8e-24)))) {
tmp = x * (z - y);
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -3.7e-19) or (not (x <= -6.2e-145) and ((x <= -5.8e-187) or not (x <= 5.8e-24))): tmp = x * (z - y) else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -3.7e-19) || (!(x <= -6.2e-145) && ((x <= -5.8e-187) || !(x <= 5.8e-24)))) tmp = Float64(x * Float64(z - y)); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -3.7e-19) || (~((x <= -6.2e-145)) && ((x <= -5.8e-187) || ~((x <= 5.8e-24))))) tmp = x * (z - y); else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -3.7e-19], And[N[Not[LessEqual[x, -6.2e-145]], $MachinePrecision], Or[LessEqual[x, -5.8e-187], N[Not[LessEqual[x, 5.8e-24]], $MachinePrecision]]]], N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{-19} \lor \neg \left(x \leq -6.2 \cdot 10^{-145}\right) \land \left(x \leq -5.8 \cdot 10^{-187} \lor \neg \left(x \leq 5.8 \cdot 10^{-24}\right)\right):\\
\;\;\;\;x \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -3.70000000000000005e-19 or -6.20000000000000001e-145 < x < -5.79999999999999977e-187 or 5.7999999999999997e-24 < x Initial program 93.6%
Taylor expanded in x around inf 96.5%
mul-1-neg96.5%
sub-neg96.5%
Simplified96.5%
if -3.70000000000000005e-19 < x < -6.20000000000000001e-145 or -5.79999999999999977e-187 < x < 5.7999999999999997e-24Initial program 100.0%
Taylor expanded in x around 0 79.2%
Final simplification88.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- z y))))
(if (<= x -0.38)
t_0
(if (<= x -5.8e-145)
(* y (- 1.0 x))
(if (or (<= x -5.8e-187) (not (<= x 9.2e-25))) t_0 y)))))
double code(double x, double y, double z) {
double t_0 = x * (z - y);
double tmp;
if (x <= -0.38) {
tmp = t_0;
} else if (x <= -5.8e-145) {
tmp = y * (1.0 - x);
} else if ((x <= -5.8e-187) || !(x <= 9.2e-25)) {
tmp = t_0;
} else {
tmp = y;
}
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 = x * (z - y)
if (x <= (-0.38d0)) then
tmp = t_0
else if (x <= (-5.8d-145)) then
tmp = y * (1.0d0 - x)
else if ((x <= (-5.8d-187)) .or. (.not. (x <= 9.2d-25))) then
tmp = t_0
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (z - y);
double tmp;
if (x <= -0.38) {
tmp = t_0;
} else if (x <= -5.8e-145) {
tmp = y * (1.0 - x);
} else if ((x <= -5.8e-187) || !(x <= 9.2e-25)) {
tmp = t_0;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z - y) tmp = 0 if x <= -0.38: tmp = t_0 elif x <= -5.8e-145: tmp = y * (1.0 - x) elif (x <= -5.8e-187) or not (x <= 9.2e-25): tmp = t_0 else: tmp = y return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z - y)) tmp = 0.0 if (x <= -0.38) tmp = t_0; elseif (x <= -5.8e-145) tmp = Float64(y * Float64(1.0 - x)); elseif ((x <= -5.8e-187) || !(x <= 9.2e-25)) tmp = t_0; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z - y); tmp = 0.0; if (x <= -0.38) tmp = t_0; elseif (x <= -5.8e-145) tmp = y * (1.0 - x); elseif ((x <= -5.8e-187) || ~((x <= 9.2e-25))) tmp = t_0; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.38], t$95$0, If[LessEqual[x, -5.8e-145], N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -5.8e-187], N[Not[LessEqual[x, 9.2e-25]], $MachinePrecision]], t$95$0, y]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z - y\right)\\
\mathbf{if}\;x \leq -0.38:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-145}:\\
\;\;\;\;y \cdot \left(1 - x\right)\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-187} \lor \neg \left(x \leq 9.2 \cdot 10^{-25}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -0.38 or -5.79999999999999968e-145 < x < -5.79999999999999977e-187 or 9.1999999999999997e-25 < x Initial program 93.4%
Taylor expanded in x around inf 98.4%
mul-1-neg98.4%
sub-neg98.4%
Simplified98.4%
if -0.38 < x < -5.79999999999999968e-145Initial program 99.9%
Taylor expanded in y around inf 73.5%
if -5.79999999999999977e-187 < x < 9.1999999999999997e-25Initial program 100.0%
Taylor expanded in x around 0 80.1%
Final simplification89.0%
(FPCore (x y z)
:precision binary64
(if (or (<= x -4.1e-19)
(and (not (<= x -5.8e-145))
(or (<= x -5.8e-187) (not (<= x 5.8e-24)))))
(* x z)
y))
double code(double x, double y, double z) {
double tmp;
if ((x <= -4.1e-19) || (!(x <= -5.8e-145) && ((x <= -5.8e-187) || !(x <= 5.8e-24)))) {
tmp = x * z;
} else {
tmp = y;
}
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 ((x <= (-4.1d-19)) .or. (.not. (x <= (-5.8d-145))) .and. (x <= (-5.8d-187)) .or. (.not. (x <= 5.8d-24))) then
tmp = x * z
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -4.1e-19) || (!(x <= -5.8e-145) && ((x <= -5.8e-187) || !(x <= 5.8e-24)))) {
tmp = x * z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -4.1e-19) or (not (x <= -5.8e-145) and ((x <= -5.8e-187) or not (x <= 5.8e-24))): tmp = x * z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -4.1e-19) || (!(x <= -5.8e-145) && ((x <= -5.8e-187) || !(x <= 5.8e-24)))) tmp = Float64(x * z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -4.1e-19) || (~((x <= -5.8e-145)) && ((x <= -5.8e-187) || ~((x <= 5.8e-24))))) tmp = x * z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -4.1e-19], And[N[Not[LessEqual[x, -5.8e-145]], $MachinePrecision], Or[LessEqual[x, -5.8e-187], N[Not[LessEqual[x, 5.8e-24]], $MachinePrecision]]]], N[(x * z), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.1 \cdot 10^{-19} \lor \neg \left(x \leq -5.8 \cdot 10^{-145}\right) \land \left(x \leq -5.8 \cdot 10^{-187} \lor \neg \left(x \leq 5.8 \cdot 10^{-24}\right)\right):\\
\;\;\;\;x \cdot z\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -4.09999999999999985e-19 or -5.79999999999999968e-145 < x < -5.79999999999999977e-187 or 5.7999999999999997e-24 < x Initial program 93.6%
Taylor expanded in y around 0 52.3%
if -4.09999999999999985e-19 < x < -5.79999999999999968e-145 or -5.79999999999999977e-187 < x < 5.7999999999999997e-24Initial program 100.0%
Taylor expanded in x around 0 79.2%
Final simplification64.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -600.0) (not (<= x 5.8e-24))) (* x (- z y)) (+ y (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -600.0) || !(x <= 5.8e-24)) {
tmp = x * (z - y);
} else {
tmp = y + (x * 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 ((x <= (-600.0d0)) .or. (.not. (x <= 5.8d-24))) then
tmp = x * (z - y)
else
tmp = y + (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -600.0) || !(x <= 5.8e-24)) {
tmp = x * (z - y);
} else {
tmp = y + (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -600.0) or not (x <= 5.8e-24): tmp = x * (z - y) else: tmp = y + (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -600.0) || !(x <= 5.8e-24)) tmp = Float64(x * Float64(z - y)); else tmp = Float64(y + Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -600.0) || ~((x <= 5.8e-24))) tmp = x * (z - y); else tmp = y + (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -600.0], N[Not[LessEqual[x, 5.8e-24]], $MachinePrecision]], N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision], N[(y + N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -600 \lor \neg \left(x \leq 5.8 \cdot 10^{-24}\right):\\
\;\;\;\;x \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;y + x \cdot z\\
\end{array}
\end{array}
if x < -600 or 5.7999999999999997e-24 < x Initial program 92.9%
Taylor expanded in x around inf 99.8%
mul-1-neg99.8%
sub-neg99.8%
Simplified99.8%
if -600 < x < 5.7999999999999997e-24Initial program 100.0%
remove-double-neg100.0%
distribute-rgt-neg-out100.0%
neg-sub0100.0%
neg-sub0100.0%
*-commutative100.0%
distribute-lft-neg-in100.0%
remove-double-neg100.0%
distribute-rgt-out--100.0%
*-lft-identity100.0%
associate-+l-100.0%
distribute-lft-out--100.0%
Simplified100.0%
Taylor expanded in y around 0 99.1%
neg-mul-199.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
Simplified99.1%
sub-neg99.1%
+-commutative99.1%
distribute-rgt-neg-out99.1%
remove-double-neg99.1%
Applied egg-rr99.1%
Final simplification99.4%
(FPCore (x y z) :precision binary64 y)
double code(double x, double y, double z) {
return y;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y
end function
public static double code(double x, double y, double z) {
return y;
}
def code(x, y, z): return y
function code(x, y, z) return y end
function tmp = code(x, y, z) tmp = y; end
code[x_, y_, z_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 96.5%
Taylor expanded in x around 0 38.4%
(FPCore (x y z) :precision binary64 (- y (* x (- y z))))
double code(double x, double y, double z) {
return y - (x * (y - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y - (x * (y - z))
end function
public static double code(double x, double y, double z) {
return y - (x * (y - z));
}
def code(x, y, z): return y - (x * (y - z))
function code(x, y, z) return Float64(y - Float64(x * Float64(y - z))) end
function tmp = code(x, y, z) tmp = y - (x * (y - z)); end
code[x_, y_, z_] := N[(y - N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y - x \cdot \left(y - z\right)
\end{array}
herbie shell --seed 2024092
(FPCore (x y z)
:name "Diagrams.Color.HSV:lerp from diagrams-contrib-1.3.0.5"
:precision binary64
:alt
(- y (* x (- y z)))
(+ (* (- 1.0 x) y) (* x z)))