
(FPCore (x y z) :precision binary64 (+ (* x (+ y z)) (* z 5.0)))
double code(double x, double y, double z) {
return (x * (y + z)) + (z * 5.0);
}
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)) + (z * 5.0d0)
end function
public static double code(double x, double y, double z) {
return (x * (y + z)) + (z * 5.0);
}
def code(x, y, z): return (x * (y + z)) + (z * 5.0)
function code(x, y, z) return Float64(Float64(x * Float64(y + z)) + Float64(z * 5.0)) end
function tmp = code(x, y, z) tmp = (x * (y + z)) + (z * 5.0); end
code[x_, y_, z_] := N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(z * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(y + z\right) + z \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (* x (+ y z)) (* z 5.0)))
double code(double x, double y, double z) {
return (x * (y + z)) + (z * 5.0);
}
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)) + (z * 5.0d0)
end function
public static double code(double x, double y, double z) {
return (x * (y + z)) + (z * 5.0);
}
def code(x, y, z): return (x * (y + z)) + (z * 5.0)
function code(x, y, z) return Float64(Float64(x * Float64(y + z)) + Float64(z * 5.0)) end
function tmp = code(x, y, z) tmp = (x * (y + z)) + (z * 5.0); end
code[x_, y_, z_] := N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] + N[(z * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(y + z\right) + z \cdot 5
\end{array}
(FPCore (x y z) :precision binary64 (fma z 5.0 (* (+ z y) x)))
double code(double x, double y, double z) {
return fma(z, 5.0, ((z + y) * x));
}
function code(x, y, z) return fma(z, 5.0, Float64(Float64(z + y) * x)) end
code[x_, y_, z_] := N[(z * 5.0 + N[(N[(z + y), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, 5, \left(z + y\right) \cdot x\right)
\end{array}
Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f64100.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
Applied rewrites100.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -5.0) (not (<= x 5.0))) (* (+ y z) x) (fma 5.0 z (* x y))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.0) || !(x <= 5.0)) {
tmp = (y + z) * x;
} else {
tmp = fma(5.0, z, (x * y));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if ((x <= -5.0) || !(x <= 5.0)) tmp = Float64(Float64(y + z) * x); else tmp = fma(5.0, z, Float64(x * y)); end return tmp end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.0], N[Not[LessEqual[x, 5.0]], $MachinePrecision]], N[(N[(y + z), $MachinePrecision] * x), $MachinePrecision], N[(5.0 * z + N[(x * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \lor \neg \left(x \leq 5\right):\\
\;\;\;\;\left(y + z\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(5, z, x \cdot y\right)\\
\end{array}
\end{array}
if x < -5 or 5 < x Initial program 100.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f64100.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
Applied rewrites100.0%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
lift-*.f64N/A
lift-*.f64N/A
associate-+r+N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lift--.f64N/A
*-commutativeN/A
lower-fma.f6498.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.2
Applied rewrites98.2%
Taylor expanded in x around -inf
distribute-lft-inN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-+.f6498.0
Applied rewrites98.0%
Taylor expanded in x around -inf
mul-1-negN/A
distribute-lft-inN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
remove-double-negN/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6498.0
Applied rewrites98.0%
if -5 < x < 5Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f64100.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
Applied rewrites100.0%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
lift-*.f64N/A
lift-*.f64N/A
associate-+r+N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lift--.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites98.2%
Final simplification98.1%
(FPCore (x y z) :precision binary64 (if (or (<= x -3.7e-9) (not (<= x 3.6e-90))) (* (+ y z) x) (fma z 5.0 (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.7e-9) || !(x <= 3.6e-90)) {
tmp = (y + z) * x;
} else {
tmp = fma(z, 5.0, (x * z));
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if ((x <= -3.7e-9) || !(x <= 3.6e-90)) tmp = Float64(Float64(y + z) * x); else tmp = fma(z, 5.0, Float64(x * z)); end return tmp end
code[x_, y_, z_] := If[Or[LessEqual[x, -3.7e-9], N[Not[LessEqual[x, 3.6e-90]], $MachinePrecision]], N[(N[(y + z), $MachinePrecision] * x), $MachinePrecision], N[(z * 5.0 + N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{-9} \lor \neg \left(x \leq 3.6 \cdot 10^{-90}\right):\\
\;\;\;\;\left(y + z\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, 5, x \cdot z\right)\\
\end{array}
\end{array}
if x < -3.7e-9 or 3.59999999999999981e-90 < x Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f64100.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
Applied rewrites100.0%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
lift-*.f64N/A
lift-*.f64N/A
associate-+r+N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lift--.f64N/A
*-commutativeN/A
lower-fma.f6498.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.5
Applied rewrites98.5%
Taylor expanded in x around -inf
distribute-lft-inN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-+.f6490.3
Applied rewrites90.3%
Taylor expanded in x around -inf
mul-1-negN/A
distribute-lft-inN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
remove-double-negN/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6490.3
Applied rewrites90.3%
if -3.7e-9 < x < 3.59999999999999981e-90Initial program 99.8%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f6474.8
Applied rewrites74.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6474.9
Applied rewrites74.9%
Final simplification83.0%
(FPCore (x y z) :precision binary64 (if (<= x -3.55e-10) (* y x) (if (<= x 3.6e-90) (* 5.0 z) (if (<= x 3.1e+82) (* y x) (* x z)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.55e-10) {
tmp = y * x;
} else if (x <= 3.6e-90) {
tmp = 5.0 * z;
} else if (x <= 3.1e+82) {
tmp = y * x;
} else {
tmp = 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 <= (-3.55d-10)) then
tmp = y * x
else if (x <= 3.6d-90) then
tmp = 5.0d0 * z
else if (x <= 3.1d+82) then
tmp = y * x
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.55e-10) {
tmp = y * x;
} else if (x <= 3.6e-90) {
tmp = 5.0 * z;
} else if (x <= 3.1e+82) {
tmp = y * x;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.55e-10: tmp = y * x elif x <= 3.6e-90: tmp = 5.0 * z elif x <= 3.1e+82: tmp = y * x else: tmp = x * z return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.55e-10) tmp = Float64(y * x); elseif (x <= 3.6e-90) tmp = Float64(5.0 * z); elseif (x <= 3.1e+82) tmp = Float64(y * x); else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.55e-10) tmp = y * x; elseif (x <= 3.6e-90) tmp = 5.0 * z; elseif (x <= 3.1e+82) tmp = y * x; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.55e-10], N[(y * x), $MachinePrecision], If[LessEqual[x, 3.6e-90], N[(5.0 * z), $MachinePrecision], If[LessEqual[x, 3.1e+82], N[(y * x), $MachinePrecision], N[(x * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.55 \cdot 10^{-10}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-90}:\\
\;\;\;\;5 \cdot z\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+82}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if x < -3.5500000000000001e-10 or 3.59999999999999981e-90 < x < 3.10000000000000032e82Initial program 99.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6460.8
Applied rewrites60.8%
if -3.5500000000000001e-10 < x < 3.59999999999999981e-90Initial program 99.8%
Taylor expanded in x around 0
lower-*.f6474.4
Applied rewrites74.4%
if 3.10000000000000032e82 < x Initial program 100.0%
Taylor expanded in y around 0
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f6460.1
Applied rewrites60.1%
Applied rewrites60.0%
Taylor expanded in x around inf
Applied rewrites60.1%
Taylor expanded in x around inf
Applied rewrites60.1%
(FPCore (x y z) :precision binary64 (if (or (<= x -3.7e-9) (not (<= x 3.6e-90))) (* (+ y z) x) (* (- x -5.0) z)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.7e-9) || !(x <= 3.6e-90)) {
tmp = (y + z) * x;
} else {
tmp = (x - -5.0) * 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 <= (-3.7d-9)) .or. (.not. (x <= 3.6d-90))) then
tmp = (y + z) * x
else
tmp = (x - (-5.0d0)) * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -3.7e-9) || !(x <= 3.6e-90)) {
tmp = (y + z) * x;
} else {
tmp = (x - -5.0) * z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -3.7e-9) or not (x <= 3.6e-90): tmp = (y + z) * x else: tmp = (x - -5.0) * z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -3.7e-9) || !(x <= 3.6e-90)) tmp = Float64(Float64(y + z) * x); else tmp = Float64(Float64(x - -5.0) * z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -3.7e-9) || ~((x <= 3.6e-90))) tmp = (y + z) * x; else tmp = (x - -5.0) * z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -3.7e-9], N[Not[LessEqual[x, 3.6e-90]], $MachinePrecision]], N[(N[(y + z), $MachinePrecision] * x), $MachinePrecision], N[(N[(x - -5.0), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{-9} \lor \neg \left(x \leq 3.6 \cdot 10^{-90}\right):\\
\;\;\;\;\left(y + z\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(x - -5\right) \cdot z\\
\end{array}
\end{array}
if x < -3.7e-9 or 3.59999999999999981e-90 < x Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f64100.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
Applied rewrites100.0%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
+-commutativeN/A
distribute-rgt-inN/A
lift-*.f64N/A
lift-*.f64N/A
associate-+r+N/A
lift-*.f64N/A
lift-*.f64N/A
distribute-lft-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lift--.f64N/A
*-commutativeN/A
lower-fma.f6498.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.5
Applied rewrites98.5%
Taylor expanded in x around -inf
distribute-lft-inN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-+.f6490.3
Applied rewrites90.3%
Taylor expanded in x around -inf
mul-1-negN/A
distribute-lft-inN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
remove-double-negN/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6490.3
Applied rewrites90.3%
if -3.7e-9 < x < 3.59999999999999981e-90Initial program 99.8%
Taylor expanded in y around 0
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f6474.8
Applied rewrites74.8%
Final simplification83.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.55e-78) (not (<= z 1.15e-99))) (* (- x -5.0) z) (* y x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.55e-78) || !(z <= 1.15e-99)) {
tmp = (x - -5.0) * z;
} else {
tmp = 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 ((z <= (-2.55d-78)) .or. (.not. (z <= 1.15d-99))) then
tmp = (x - (-5.0d0)) * z
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.55e-78) || !(z <= 1.15e-99)) {
tmp = (x - -5.0) * z;
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.55e-78) or not (z <= 1.15e-99): tmp = (x - -5.0) * z else: tmp = y * x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.55e-78) || !(z <= 1.15e-99)) tmp = Float64(Float64(x - -5.0) * z); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.55e-78) || ~((z <= 1.15e-99))) tmp = (x - -5.0) * z; else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.55e-78], N[Not[LessEqual[z, 1.15e-99]], $MachinePrecision]], N[(N[(x - -5.0), $MachinePrecision] * z), $MachinePrecision], N[(y * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.55 \cdot 10^{-78} \lor \neg \left(z \leq 1.15 \cdot 10^{-99}\right):\\
\;\;\;\;\left(x - -5\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if z < -2.55e-78 or 1.1499999999999999e-99 < z Initial program 99.8%
Taylor expanded in y around 0
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f6483.0
Applied rewrites83.0%
if -2.55e-78 < z < 1.1499999999999999e-99Initial program 99.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6476.7
Applied rewrites76.7%
Final simplification80.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -0.245) (not (<= x 5.0))) (* x z) (* 5.0 z)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -0.245) || !(x <= 5.0)) {
tmp = x * z;
} else {
tmp = 5.0 * 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 <= (-0.245d0)) .or. (.not. (x <= 5.0d0))) then
tmp = x * z
else
tmp = 5.0d0 * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -0.245) || !(x <= 5.0)) {
tmp = x * z;
} else {
tmp = 5.0 * z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -0.245) or not (x <= 5.0): tmp = x * z else: tmp = 5.0 * z return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -0.245) || !(x <= 5.0)) tmp = Float64(x * z); else tmp = Float64(5.0 * z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -0.245) || ~((x <= 5.0))) tmp = x * z; else tmp = 5.0 * z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -0.245], N[Not[LessEqual[x, 5.0]], $MachinePrecision]], N[(x * z), $MachinePrecision], N[(5.0 * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.245 \lor \neg \left(x \leq 5\right):\\
\;\;\;\;x \cdot z\\
\mathbf{else}:\\
\;\;\;\;5 \cdot z\\
\end{array}
\end{array}
if x < -0.245 or 5 < x Initial program 100.0%
Taylor expanded in y around 0
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f6450.5
Applied rewrites50.5%
Applied rewrites50.4%
Taylor expanded in x around inf
Applied rewrites50.5%
Taylor expanded in x around inf
Applied rewrites48.6%
if -0.245 < x < 5Initial program 99.8%
Taylor expanded in x around 0
lower-*.f6468.4
Applied rewrites68.4%
Final simplification59.9%
(FPCore (x y z) :precision binary64 (* x z))
double code(double x, double y, double z) {
return 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 = x * z
end function
public static double code(double x, double y, double z) {
return x * z;
}
def code(x, y, z): return x * z
function code(x, y, z) return Float64(x * z) end
function tmp = code(x, y, z) tmp = x * z; end
code[x_, y_, z_] := N[(x * z), $MachinePrecision]
\begin{array}{l}
\\
x \cdot z
\end{array}
Initial program 99.9%
Taylor expanded in y around 0
distribute-rgt-inN/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
lower--.f6461.7
Applied rewrites61.7%
Applied rewrites61.6%
Taylor expanded in x around inf
Applied rewrites49.6%
Taylor expanded in x around inf
Applied rewrites23.0%
(FPCore (x y z) :precision binary64 (+ (* (+ x 5.0) z) (* x y)))
double code(double x, double y, double z) {
return ((x + 5.0) * 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 = ((x + 5.0d0) * z) + (x * y)
end function
public static double code(double x, double y, double z) {
return ((x + 5.0) * z) + (x * y);
}
def code(x, y, z): return ((x + 5.0) * z) + (x * y)
function code(x, y, z) return Float64(Float64(Float64(x + 5.0) * z) + Float64(x * y)) end
function tmp = code(x, y, z) tmp = ((x + 5.0) * z) + (x * y); end
code[x_, y_, z_] := N[(N[(N[(x + 5.0), $MachinePrecision] * z), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + 5\right) \cdot z + x \cdot y
\end{array}
herbie shell --seed 2024318
(FPCore (x y z)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, C"
:precision binary64
:alt
(! :herbie-platform default (+ (* (+ x 5) z) (* x y)))
(+ (* x (+ y z)) (* z 5.0)))