
(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 10 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 (* x (+ z y))))
double code(double x, double y, double z) {
return fma(z, 5.0, (x * (z + y)));
}
function code(x, y, z) return fma(z, 5.0, Float64(x * Float64(z + y))) end
code[x_, y_, z_] := N[(z * 5.0 + N[(x * N[(z + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, 5, x \cdot \left(z + y\right)\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z) :precision binary64 (fma x (+ z y) (* z 5.0)))
double code(double x, double y, double z) {
return fma(x, (z + y), (z * 5.0));
}
function code(x, y, z) return fma(x, Float64(z + y), Float64(z * 5.0)) end
code[x_, y_, z_] := N[(x * N[(z + y), $MachinePrecision] + N[(z * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, z + y, z \cdot 5\right)
\end{array}
Initial program 100.0%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(if (<= x -2.05e+267)
(* z x)
(if (<= x -9.5e-30)
(* x y)
(if (<= x 3.75e-6)
(* z 5.0)
(if (or (<= x 2.8e+120) (and (not (<= x 1e+155)) (<= x 5.5e+282)))
(* x y)
(* z x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.05e+267) {
tmp = z * x;
} else if (x <= -9.5e-30) {
tmp = x * y;
} else if (x <= 3.75e-6) {
tmp = z * 5.0;
} else if ((x <= 2.8e+120) || (!(x <= 1e+155) && (x <= 5.5e+282))) {
tmp = x * y;
} else {
tmp = z * 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 (x <= (-2.05d+267)) then
tmp = z * x
else if (x <= (-9.5d-30)) then
tmp = x * y
else if (x <= 3.75d-6) then
tmp = z * 5.0d0
else if ((x <= 2.8d+120) .or. (.not. (x <= 1d+155)) .and. (x <= 5.5d+282)) then
tmp = x * y
else
tmp = z * x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.05e+267) {
tmp = z * x;
} else if (x <= -9.5e-30) {
tmp = x * y;
} else if (x <= 3.75e-6) {
tmp = z * 5.0;
} else if ((x <= 2.8e+120) || (!(x <= 1e+155) && (x <= 5.5e+282))) {
tmp = x * y;
} else {
tmp = z * x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.05e+267: tmp = z * x elif x <= -9.5e-30: tmp = x * y elif x <= 3.75e-6: tmp = z * 5.0 elif (x <= 2.8e+120) or (not (x <= 1e+155) and (x <= 5.5e+282)): tmp = x * y else: tmp = z * x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.05e+267) tmp = Float64(z * x); elseif (x <= -9.5e-30) tmp = Float64(x * y); elseif (x <= 3.75e-6) tmp = Float64(z * 5.0); elseif ((x <= 2.8e+120) || (!(x <= 1e+155) && (x <= 5.5e+282))) tmp = Float64(x * y); else tmp = Float64(z * x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.05e+267) tmp = z * x; elseif (x <= -9.5e-30) tmp = x * y; elseif (x <= 3.75e-6) tmp = z * 5.0; elseif ((x <= 2.8e+120) || (~((x <= 1e+155)) && (x <= 5.5e+282))) tmp = x * y; else tmp = z * x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.05e+267], N[(z * x), $MachinePrecision], If[LessEqual[x, -9.5e-30], N[(x * y), $MachinePrecision], If[LessEqual[x, 3.75e-6], N[(z * 5.0), $MachinePrecision], If[Or[LessEqual[x, 2.8e+120], And[N[Not[LessEqual[x, 1e+155]], $MachinePrecision], LessEqual[x, 5.5e+282]]], N[(x * y), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{+267}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-30}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 3.75 \cdot 10^{-6}:\\
\;\;\;\;z \cdot 5\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+120} \lor \neg \left(x \leq 10^{+155}\right) \land x \leq 5.5 \cdot 10^{+282}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\end{array}
if x < -2.04999999999999999e267 or 2.8000000000000001e120 < x < 1.00000000000000001e155 or 5.4999999999999999e282 < x Initial program 100.0%
Taylor expanded in x around inf 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 83.8%
if -2.04999999999999999e267 < x < -9.49999999999999939e-30 or 3.7500000000000001e-6 < x < 2.8000000000000001e120 or 1.00000000000000001e155 < x < 5.4999999999999999e282Initial program 100.0%
Taylor expanded in y around inf 66.9%
if -9.49999999999999939e-30 < x < 3.7500000000000001e-6Initial program 99.9%
Taylor expanded in x around 0 71.0%
Final simplification70.7%
(FPCore (x y z) :precision binary64 (if (<= x -25000.0) (+ (* x y) (* z x)) (if (<= x 3.45) (- (* x y) (* z -5.0)) (* x (+ z y)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -25000.0) {
tmp = (x * y) + (z * x);
} else if (x <= 3.45) {
tmp = (x * y) - (z * -5.0);
} else {
tmp = x * (z + 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 <= (-25000.0d0)) then
tmp = (x * y) + (z * x)
else if (x <= 3.45d0) then
tmp = (x * y) - (z * (-5.0d0))
else
tmp = x * (z + y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -25000.0) {
tmp = (x * y) + (z * x);
} else if (x <= 3.45) {
tmp = (x * y) - (z * -5.0);
} else {
tmp = x * (z + y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -25000.0: tmp = (x * y) + (z * x) elif x <= 3.45: tmp = (x * y) - (z * -5.0) else: tmp = x * (z + y) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -25000.0) tmp = Float64(Float64(x * y) + Float64(z * x)); elseif (x <= 3.45) tmp = Float64(Float64(x * y) - Float64(z * -5.0)); else tmp = Float64(x * Float64(z + y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -25000.0) tmp = (x * y) + (z * x); elseif (x <= 3.45) tmp = (x * y) - (z * -5.0); else tmp = x * (z + y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -25000.0], N[(N[(x * y), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.45], N[(N[(x * y), $MachinePrecision] - N[(z * -5.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(z + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -25000:\\
\;\;\;\;x \cdot y + z \cdot x\\
\mathbf{elif}\;x \leq 3.45:\\
\;\;\;\;x \cdot y - z \cdot -5\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + y\right)\\
\end{array}
\end{array}
if x < -25000Initial program 99.9%
Taylor expanded in x around inf 99.9%
+-commutative99.9%
Simplified99.9%
distribute-rgt-in100.0%
*-commutative100.0%
Applied egg-rr100.0%
if -25000 < x < 3.4500000000000002Initial program 99.9%
+-commutative99.9%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in z around -inf 99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
sub-neg99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 98.6%
*-commutative98.6%
Simplified98.6%
if 3.4500000000000002 < x Initial program 100.0%
Taylor expanded in x around inf 100.0%
+-commutative100.0%
Simplified100.0%
Final simplification99.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.35e-27) (not (<= x 3.75e-6))) (* x (+ z y)) (* z 5.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.35e-27) || !(x <= 3.75e-6)) {
tmp = x * (z + y);
} else {
tmp = z * 5.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) :: tmp
if ((x <= (-2.35d-27)) .or. (.not. (x <= 3.75d-6))) then
tmp = x * (z + y)
else
tmp = z * 5.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.35e-27) || !(x <= 3.75e-6)) {
tmp = x * (z + y);
} else {
tmp = z * 5.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.35e-27) or not (x <= 3.75e-6): tmp = x * (z + y) else: tmp = z * 5.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.35e-27) || !(x <= 3.75e-6)) tmp = Float64(x * Float64(z + y)); else tmp = Float64(z * 5.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.35e-27) || ~((x <= 3.75e-6))) tmp = x * (z + y); else tmp = z * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.35e-27], N[Not[LessEqual[x, 3.75e-6]], $MachinePrecision]], N[(x * N[(z + y), $MachinePrecision]), $MachinePrecision], N[(z * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.35 \cdot 10^{-27} \lor \neg \left(x \leq 3.75 \cdot 10^{-6}\right):\\
\;\;\;\;x \cdot \left(z + y\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot 5\\
\end{array}
\end{array}
if x < -2.35000000000000016e-27 or 3.7500000000000001e-6 < x Initial program 100.0%
Taylor expanded in x around inf 98.6%
+-commutative98.6%
Simplified98.6%
if -2.35000000000000016e-27 < x < 3.7500000000000001e-6Initial program 99.9%
Taylor expanded in x around 0 71.0%
Final simplification86.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -31.0) (not (<= x 0.0061))) (* x (+ z y)) (* z (+ 5.0 x))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -31.0) || !(x <= 0.0061)) {
tmp = x * (z + y);
} else {
tmp = z * (5.0 + 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 ((x <= (-31.0d0)) .or. (.not. (x <= 0.0061d0))) then
tmp = x * (z + y)
else
tmp = z * (5.0d0 + x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -31.0) || !(x <= 0.0061)) {
tmp = x * (z + y);
} else {
tmp = z * (5.0 + x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -31.0) or not (x <= 0.0061): tmp = x * (z + y) else: tmp = z * (5.0 + x) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -31.0) || !(x <= 0.0061)) tmp = Float64(x * Float64(z + y)); else tmp = Float64(z * Float64(5.0 + x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -31.0) || ~((x <= 0.0061))) tmp = x * (z + y); else tmp = z * (5.0 + x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -31.0], N[Not[LessEqual[x, 0.0061]], $MachinePrecision]], N[(x * N[(z + y), $MachinePrecision]), $MachinePrecision], N[(z * N[(5.0 + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -31 \lor \neg \left(x \leq 0.0061\right):\\
\;\;\;\;x \cdot \left(z + y\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(5 + x\right)\\
\end{array}
\end{array}
if x < -31 or 0.00610000000000000039 < x Initial program 100.0%
Taylor expanded in x around inf 100.0%
+-commutative100.0%
Simplified100.0%
if -31 < x < 0.00610000000000000039Initial program 99.9%
Taylor expanded in y around 0 71.2%
distribute-rgt-in71.3%
Simplified71.3%
Final simplification86.7%
(FPCore (x y z) :precision binary64 (if (<= x -0.000105) (+ (* x y) (* z x)) (if (<= x 4e-6) (* z (+ 5.0 x)) (* x (+ z y)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.000105) {
tmp = (x * y) + (z * x);
} else if (x <= 4e-6) {
tmp = z * (5.0 + x);
} else {
tmp = x * (z + 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 <= (-0.000105d0)) then
tmp = (x * y) + (z * x)
else if (x <= 4d-6) then
tmp = z * (5.0d0 + x)
else
tmp = x * (z + y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -0.000105) {
tmp = (x * y) + (z * x);
} else if (x <= 4e-6) {
tmp = z * (5.0 + x);
} else {
tmp = x * (z + y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.000105: tmp = (x * y) + (z * x) elif x <= 4e-6: tmp = z * (5.0 + x) else: tmp = x * (z + y) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.000105) tmp = Float64(Float64(x * y) + Float64(z * x)); elseif (x <= 4e-6) tmp = Float64(z * Float64(5.0 + x)); else tmp = Float64(x * Float64(z + y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.000105) tmp = (x * y) + (z * x); elseif (x <= 4e-6) tmp = z * (5.0 + x); else tmp = x * (z + y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.000105], N[(N[(x * y), $MachinePrecision] + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4e-6], N[(z * N[(5.0 + x), $MachinePrecision]), $MachinePrecision], N[(x * N[(z + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.000105:\\
\;\;\;\;x \cdot y + z \cdot x\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-6}:\\
\;\;\;\;z \cdot \left(5 + x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z + y\right)\\
\end{array}
\end{array}
if x < -1.05e-4Initial program 99.9%
Taylor expanded in x around inf 99.9%
+-commutative99.9%
Simplified99.9%
distribute-rgt-in100.0%
*-commutative100.0%
Applied egg-rr100.0%
if -1.05e-4 < x < 3.99999999999999982e-6Initial program 99.9%
Taylor expanded in y around 0 71.2%
distribute-rgt-in71.3%
Simplified71.3%
if 3.99999999999999982e-6 < x Initial program 100.0%
Taylor expanded in x around inf 100.0%
+-commutative100.0%
Simplified100.0%
Final simplification86.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.4e-29) (not (<= x 3.75e-6))) (* x y) (* z 5.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.4e-29) || !(x <= 3.75e-6)) {
tmp = x * y;
} else {
tmp = z * 5.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) :: tmp
if ((x <= (-2.4d-29)) .or. (.not. (x <= 3.75d-6))) then
tmp = x * y
else
tmp = z * 5.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.4e-29) || !(x <= 3.75e-6)) {
tmp = x * y;
} else {
tmp = z * 5.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.4e-29) or not (x <= 3.75e-6): tmp = x * y else: tmp = z * 5.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.4e-29) || !(x <= 3.75e-6)) tmp = Float64(x * y); else tmp = Float64(z * 5.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.4e-29) || ~((x <= 3.75e-6))) tmp = x * y; else tmp = z * 5.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.4e-29], N[Not[LessEqual[x, 3.75e-6]], $MachinePrecision]], N[(x * y), $MachinePrecision], N[(z * 5.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{-29} \lor \neg \left(x \leq 3.75 \cdot 10^{-6}\right):\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;z \cdot 5\\
\end{array}
\end{array}
if x < -2.39999999999999992e-29 or 3.7500000000000001e-6 < x Initial program 100.0%
Taylor expanded in y around inf 58.0%
if -2.39999999999999992e-29 < x < 3.7500000000000001e-6Initial program 99.9%
Taylor expanded in x around 0 71.0%
Final simplification63.8%
(FPCore (x y z) :precision binary64 (+ (* x (+ z y)) (* z 5.0)))
double code(double x, double y, double z) {
return (x * (z + y)) + (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 * (z + y)) + (z * 5.0d0)
end function
public static double code(double x, double y, double z) {
return (x * (z + y)) + (z * 5.0);
}
def code(x, y, z): return (x * (z + y)) + (z * 5.0)
function code(x, y, z) return Float64(Float64(x * Float64(z + y)) + Float64(z * 5.0)) end
function tmp = code(x, y, z) tmp = (x * (z + y)) + (z * 5.0); end
code[x_, y_, z_] := N[(N[(x * N[(z + y), $MachinePrecision]), $MachinePrecision] + N[(z * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(z + y\right) + z \cdot 5
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z) :precision binary64 (* z 5.0))
double code(double x, double y, double z) {
return 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 = z * 5.0d0
end function
public static double code(double x, double y, double z) {
return z * 5.0;
}
def code(x, y, z): return z * 5.0
function code(x, y, z) return Float64(z * 5.0) end
function tmp = code(x, y, z) tmp = z * 5.0; end
code[x_, y_, z_] := N[(z * 5.0), $MachinePrecision]
\begin{array}{l}
\\
z \cdot 5
\end{array}
Initial program 100.0%
Taylor expanded in x around 0 33.7%
Final simplification33.7%
(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 2024021
(FPCore (x y z)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, C"
:precision binary64
:herbie-target
(+ (* (+ x 5.0) z) (* x y))
(+ (* x (+ y z)) (* z 5.0)))