
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
double code(double x, double y, double z) {
return x * (1.0 - (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 = x * (1.0d0 - (y * z))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - (y * z));
}
def code(x, y, z): return x * (1.0 - (y * z))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(y * z))) end
function tmp = code(x, y, z) tmp = x * (1.0 - (y * z)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - y \cdot z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
double code(double x, double y, double z) {
return x * (1.0 - (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 = x * (1.0d0 - (y * z))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - (y * z));
}
def code(x, y, z): return x * (1.0 - (y * z))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(y * z))) end
function tmp = code(x, y, z) tmp = x * (1.0 - (y * z)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - y \cdot z\right)
\end{array}
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* y z) 2e+59) (+ x (* (* y (- z)) x)) (* y (* -1.0 (* x z)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if ((y * z) <= 2e+59) {
tmp = x + ((y * -z) * x);
} else {
tmp = y * (-1.0 * (x * z));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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 * z) <= 2d+59) then
tmp = x + ((y * -z) * x)
else
tmp = y * ((-1.0d0) * (x * z))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if ((y * z) <= 2e+59) {
tmp = x + ((y * -z) * x);
} else {
tmp = y * (-1.0 * (x * z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if (y * z) <= 2e+59: tmp = x + ((y * -z) * x) else: tmp = y * (-1.0 * (x * z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (Float64(y * z) <= 2e+59) tmp = Float64(x + Float64(Float64(y * Float64(-z)) * x)); else tmp = Float64(y * Float64(-1.0 * Float64(x * z))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((y * z) <= 2e+59)
tmp = x + ((y * -z) * x);
else
tmp = y * (-1.0 * (x * z));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(y * z), $MachinePrecision], 2e+59], N[(x + N[(N[(y * (-z)), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(y * N[(-1.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot z \leq 2 \cdot 10^{+59}:\\
\;\;\;\;x + \left(y \cdot \left(-z\right)\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-1 \cdot \left(x \cdot z\right)\right)\\
\end{array}
\end{array}
if (*.f64 y z) < 1.99999999999999994e59Initial program 98.0%
sub-neg98.0%
distribute-rgt-in98.1%
*-un-lft-identity98.1%
distribute-rgt-neg-in98.1%
Applied egg-rr98.1%
if 1.99999999999999994e59 < (*.f64 y z) Initial program 86.3%
Taylor expanded in y around inf 96.3%
Taylor expanded in z around inf 98.1%
NOTE: x, y, and z should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* z (* x y)))))
(if (<= (* y z) -1000000000.0)
t_0
(if (<= (* y z) 0.5) x (if (<= (* y z) 5e+187) (- (* x (* y z))) t_0)))))assert(x < y && y < z);
double code(double x, double y, double z) {
double t_0 = -(z * (x * y));
double tmp;
if ((y * z) <= -1000000000.0) {
tmp = t_0;
} else if ((y * z) <= 0.5) {
tmp = x;
} else if ((y * z) <= 5e+187) {
tmp = -(x * (y * z));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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 * (x * y))
if ((y * z) <= (-1000000000.0d0)) then
tmp = t_0
else if ((y * z) <= 0.5d0) then
tmp = x
else if ((y * z) <= 5d+187) then
tmp = -(x * (y * z))
else
tmp = t_0
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double t_0 = -(z * (x * y));
double tmp;
if ((y * z) <= -1000000000.0) {
tmp = t_0;
} else if ((y * z) <= 0.5) {
tmp = x;
} else if ((y * z) <= 5e+187) {
tmp = -(x * (y * z));
} else {
tmp = t_0;
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): t_0 = -(z * (x * y)) tmp = 0 if (y * z) <= -1000000000.0: tmp = t_0 elif (y * z) <= 0.5: tmp = x elif (y * z) <= 5e+187: tmp = -(x * (y * z)) else: tmp = t_0 return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) t_0 = Float64(-Float64(z * Float64(x * y))) tmp = 0.0 if (Float64(y * z) <= -1000000000.0) tmp = t_0; elseif (Float64(y * z) <= 0.5) tmp = x; elseif (Float64(y * z) <= 5e+187) tmp = Float64(-Float64(x * Float64(y * z))); else tmp = t_0; end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
t_0 = -(z * (x * y));
tmp = 0.0;
if ((y * z) <= -1000000000.0)
tmp = t_0;
elseif ((y * z) <= 0.5)
tmp = x;
elseif ((y * z) <= 5e+187)
tmp = -(x * (y * z));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = (-N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[N[(y * z), $MachinePrecision], -1000000000.0], t$95$0, If[LessEqual[N[(y * z), $MachinePrecision], 0.5], x, If[LessEqual[N[(y * z), $MachinePrecision], 5e+187], (-N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), t$95$0]]]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
t_0 := -z \cdot \left(x \cdot y\right)\\
\mathbf{if}\;y \cdot z \leq -1000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \cdot z \leq 0.5:\\
\;\;\;\;x\\
\mathbf{elif}\;y \cdot z \leq 5 \cdot 10^{+187}:\\
\;\;\;\;-x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 y z) < -1e9 or 5.0000000000000001e187 < (*.f64 y z) Initial program 87.4%
Taylor expanded in y around inf 95.6%
Taylor expanded in z around inf 96.3%
*-commutative96.3%
mul-1-neg96.3%
distribute-lft-neg-out96.3%
add-sqr-sqrt41.2%
sqrt-unprod37.6%
sqr-neg37.6%
mul-1-neg37.6%
mul-1-neg37.6%
sqrt-unprod0.3%
add-sqr-sqrt0.6%
mul-1-neg0.6%
*-commutative0.6%
distribute-rgt-neg-in0.6%
associate-*r*0.6%
distribute-lft-neg-in0.6%
mul-1-neg0.6%
add-sqr-sqrt0.3%
sqrt-unprod44.9%
mul-1-neg44.9%
*-commutative44.9%
mul-1-neg44.9%
*-commutative44.9%
sqr-neg44.9%
Applied egg-rr95.2%
if -1e9 < (*.f64 y z) < 0.5Initial program 100.0%
Taylor expanded in y around 0 97.4%
if 0.5 < (*.f64 y z) < 5.0000000000000001e187Initial program 99.6%
Taylor expanded in y around inf 93.3%
Taylor expanded in z around inf 91.9%
*-commutative91.9%
mul-1-neg91.9%
distribute-lft-neg-out91.9%
add-sqr-sqrt47.9%
sqrt-unprod33.8%
sqr-neg33.8%
mul-1-neg33.8%
mul-1-neg33.8%
sqrt-unprod0.9%
add-sqr-sqrt1.5%
mul-1-neg1.5%
*-commutative1.5%
distribute-rgt-neg-in1.5%
associate-*r*1.6%
distribute-lft-neg-in1.6%
mul-1-neg1.6%
add-sqr-sqrt1.0%
sqrt-unprod27.7%
mul-1-neg27.7%
*-commutative27.7%
mul-1-neg27.7%
*-commutative27.7%
sqr-neg27.7%
Applied egg-rr86.0%
Taylor expanded in z around 0 98.1%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (let* ((t_0 (- (* x (* y z))))) (if (<= (* y z) -1000000000.0) t_0 (if (<= (* y z) 0.5) x t_0))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double t_0 = -(x * (y * z));
double tmp;
if ((y * z) <= -1000000000.0) {
tmp = t_0;
} else if ((y * z) <= 0.5) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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 * (y * z))
if ((y * z) <= (-1000000000.0d0)) then
tmp = t_0
else if ((y * z) <= 0.5d0) then
tmp = x
else
tmp = t_0
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double t_0 = -(x * (y * z));
double tmp;
if ((y * z) <= -1000000000.0) {
tmp = t_0;
} else if ((y * z) <= 0.5) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): t_0 = -(x * (y * z)) tmp = 0 if (y * z) <= -1000000000.0: tmp = t_0 elif (y * z) <= 0.5: tmp = x else: tmp = t_0 return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) t_0 = Float64(-Float64(x * Float64(y * z))) tmp = 0.0 if (Float64(y * z) <= -1000000000.0) tmp = t_0; elseif (Float64(y * z) <= 0.5) tmp = x; else tmp = t_0; end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
t_0 = -(x * (y * z));
tmp = 0.0;
if ((y * z) <= -1000000000.0)
tmp = t_0;
elseif ((y * z) <= 0.5)
tmp = x;
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = (-N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[N[(y * z), $MachinePrecision], -1000000000.0], t$95$0, If[LessEqual[N[(y * z), $MachinePrecision], 0.5], x, t$95$0]]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
t_0 := -x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;y \cdot z \leq -1000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \cdot z \leq 0.5:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 y z) < -1e9 or 0.5 < (*.f64 y z) Initial program 90.5%
Taylor expanded in y around inf 95.0%
Taylor expanded in z around inf 95.2%
*-commutative95.2%
mul-1-neg95.2%
distribute-lft-neg-out95.2%
add-sqr-sqrt42.9%
sqrt-unprod36.6%
sqr-neg36.6%
mul-1-neg36.6%
mul-1-neg36.6%
sqrt-unprod0.5%
add-sqr-sqrt0.8%
mul-1-neg0.8%
*-commutative0.8%
distribute-rgt-neg-in0.8%
associate-*r*0.8%
distribute-lft-neg-in0.8%
mul-1-neg0.8%
add-sqr-sqrt0.5%
sqrt-unprod40.5%
mul-1-neg40.5%
*-commutative40.5%
mul-1-neg40.5%
*-commutative40.5%
sqr-neg40.5%
Applied egg-rr92.8%
Taylor expanded in z around 0 89.9%
if -1e9 < (*.f64 y z) < 0.5Initial program 100.0%
Taylor expanded in y around 0 97.4%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* y z) 5e+187) (* x (- 1.0 (* y z))) (- (* z (* x y)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if ((y * z) <= 5e+187) {
tmp = x * (1.0 - (y * z));
} else {
tmp = -(z * (x * y));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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 * z) <= 5d+187) then
tmp = x * (1.0d0 - (y * z))
else
tmp = -(z * (x * y))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if ((y * z) <= 5e+187) {
tmp = x * (1.0 - (y * z));
} else {
tmp = -(z * (x * y));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if (y * z) <= 5e+187: tmp = x * (1.0 - (y * z)) else: tmp = -(z * (x * y)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (Float64(y * z) <= 5e+187) tmp = Float64(x * Float64(1.0 - Float64(y * z))); else tmp = Float64(-Float64(z * Float64(x * y))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((y * z) <= 5e+187)
tmp = x * (1.0 - (y * z));
else
tmp = -(z * (x * y));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(y * z), $MachinePrecision], 5e+187], N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision])]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot z \leq 5 \cdot 10^{+187}:\\
\;\;\;\;x \cdot \left(1 - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;-z \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 y z) < 5.0000000000000001e187Initial program 98.2%
if 5.0000000000000001e187 < (*.f64 y z) Initial program 77.7%
Taylor expanded in y around inf 96.9%
Taylor expanded in z around inf 99.9%
*-commutative99.9%
mul-1-neg99.9%
distribute-lft-neg-out99.9%
add-sqr-sqrt49.7%
sqrt-unprod44.5%
sqr-neg44.5%
mul-1-neg44.5%
mul-1-neg44.5%
sqrt-unprod0.1%
add-sqr-sqrt0.4%
mul-1-neg0.4%
*-commutative0.4%
distribute-rgt-neg-in0.4%
associate-*r*0.4%
distribute-lft-neg-in0.4%
mul-1-neg0.4%
add-sqr-sqrt0.1%
sqrt-unprod47.1%
mul-1-neg47.1%
*-commutative47.1%
mul-1-neg47.1%
*-commutative47.1%
sqr-neg47.1%
Applied egg-rr99.8%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= (* y z) 2e+59) (* x (- 1.0 (* y z))) (* y (* -1.0 (* x z)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if ((y * z) <= 2e+59) {
tmp = x * (1.0 - (y * z));
} else {
tmp = y * (-1.0 * (x * z));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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 * z) <= 2d+59) then
tmp = x * (1.0d0 - (y * z))
else
tmp = y * ((-1.0d0) * (x * z))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if ((y * z) <= 2e+59) {
tmp = x * (1.0 - (y * z));
} else {
tmp = y * (-1.0 * (x * z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if (y * z) <= 2e+59: tmp = x * (1.0 - (y * z)) else: tmp = y * (-1.0 * (x * z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (Float64(y * z) <= 2e+59) tmp = Float64(x * Float64(1.0 - Float64(y * z))); else tmp = Float64(y * Float64(-1.0 * Float64(x * z))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((y * z) <= 2e+59)
tmp = x * (1.0 - (y * z));
else
tmp = y * (-1.0 * (x * z));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[N[(y * z), $MachinePrecision], 2e+59], N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(-1.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot z \leq 2 \cdot 10^{+59}:\\
\;\;\;\;x \cdot \left(1 - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-1 \cdot \left(x \cdot z\right)\right)\\
\end{array}
\end{array}
if (*.f64 y z) < 1.99999999999999994e59Initial program 98.0%
if 1.99999999999999994e59 < (*.f64 y z) Initial program 86.3%
Taylor expanded in y around inf 96.3%
Taylor expanded in z around inf 98.1%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y -1.8e+117) (/ (* x y) y) x))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -1.8e+117) {
tmp = (x * y) / y;
} else {
tmp = x;
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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.8d+117)) then
tmp = (x * y) / y
else
tmp = x
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.8e+117) {
tmp = (x * y) / y;
} else {
tmp = x;
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -1.8e+117: tmp = (x * y) / y else: tmp = x return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -1.8e+117) tmp = Float64(Float64(x * y) / y); else tmp = x; end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -1.8e+117)
tmp = (x * y) / y;
else
tmp = x;
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, -1.8e+117], N[(N[(x * y), $MachinePrecision] / y), $MachinePrecision], x]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+117}:\\
\;\;\;\;\frac{x \cdot y}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.80000000000000006e117Initial program 89.2%
Taylor expanded in y around inf 96.0%
Taylor expanded in z around 0 12.9%
associate-*r/16.3%
*-commutative16.3%
Applied egg-rr16.3%
if -1.80000000000000006e117 < y Initial program 96.5%
Taylor expanded in y around 0 58.8%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 x)
assert(x < y && y < z);
double code(double x, double y, double z) {
return x;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
return x;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): return x
x, y, z = sort([x, y, z]) function code(x, y, z) return x end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp = code(x, y, z)
tmp = x;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := x
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
x
\end{array}
Initial program 95.5%
Taylor expanded in y around 0 52.6%
herbie shell --seed 2024050 -o generate:simplify
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
:precision binary64
(* x (- 1.0 (* y z))))