
(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 9 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 99.9%
+-commutative99.9%
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 99.9%
fma-def99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= y -2.3e+94)
(* x y)
(if (<= y -1.08e-58)
(* z 5.0)
(if (<= y -1.3e-133)
(* z x)
(if (<= y 6.8e-140)
(* z 5.0)
(if (<= y 2e-55) (* z x) (if (<= y 8.5e-42) (* z 5.0) (* x y))))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.3e+94) {
tmp = x * y;
} else if (y <= -1.08e-58) {
tmp = z * 5.0;
} else if (y <= -1.3e-133) {
tmp = z * x;
} else if (y <= 6.8e-140) {
tmp = z * 5.0;
} else if (y <= 2e-55) {
tmp = z * x;
} else if (y <= 8.5e-42) {
tmp = z * 5.0;
} else {
tmp = x * 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 (y <= (-2.3d+94)) then
tmp = x * y
else if (y <= (-1.08d-58)) then
tmp = z * 5.0d0
else if (y <= (-1.3d-133)) then
tmp = z * x
else if (y <= 6.8d-140) then
tmp = z * 5.0d0
else if (y <= 2d-55) then
tmp = z * x
else if (y <= 8.5d-42) then
tmp = z * 5.0d0
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.3e+94) {
tmp = x * y;
} else if (y <= -1.08e-58) {
tmp = z * 5.0;
} else if (y <= -1.3e-133) {
tmp = z * x;
} else if (y <= 6.8e-140) {
tmp = z * 5.0;
} else if (y <= 2e-55) {
tmp = z * x;
} else if (y <= 8.5e-42) {
tmp = z * 5.0;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.3e+94: tmp = x * y elif y <= -1.08e-58: tmp = z * 5.0 elif y <= -1.3e-133: tmp = z * x elif y <= 6.8e-140: tmp = z * 5.0 elif y <= 2e-55: tmp = z * x elif y <= 8.5e-42: tmp = z * 5.0 else: tmp = x * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.3e+94) tmp = Float64(x * y); elseif (y <= -1.08e-58) tmp = Float64(z * 5.0); elseif (y <= -1.3e-133) tmp = Float64(z * x); elseif (y <= 6.8e-140) tmp = Float64(z * 5.0); elseif (y <= 2e-55) tmp = Float64(z * x); elseif (y <= 8.5e-42) tmp = Float64(z * 5.0); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.3e+94) tmp = x * y; elseif (y <= -1.08e-58) tmp = z * 5.0; elseif (y <= -1.3e-133) tmp = z * x; elseif (y <= 6.8e-140) tmp = z * 5.0; elseif (y <= 2e-55) tmp = z * x; elseif (y <= 8.5e-42) tmp = z * 5.0; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.3e+94], N[(x * y), $MachinePrecision], If[LessEqual[y, -1.08e-58], N[(z * 5.0), $MachinePrecision], If[LessEqual[y, -1.3e-133], N[(z * x), $MachinePrecision], If[LessEqual[y, 6.8e-140], N[(z * 5.0), $MachinePrecision], If[LessEqual[y, 2e-55], N[(z * x), $MachinePrecision], If[LessEqual[y, 8.5e-42], N[(z * 5.0), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+94}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -1.08 \cdot 10^{-58}:\\
\;\;\;\;z \cdot 5\\
\mathbf{elif}\;y \leq -1.3 \cdot 10^{-133}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-140}:\\
\;\;\;\;z \cdot 5\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-55}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-42}:\\
\;\;\;\;z \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -2.3e94 or 8.4999999999999996e-42 < y Initial program 100.0%
Taylor expanded in y around inf 85.3%
if -2.3e94 < y < -1.08e-58 or -1.3e-133 < y < 6.80000000000000017e-140 or 1.99999999999999999e-55 < y < 8.4999999999999996e-42Initial program 99.8%
Taylor expanded in x around 0 53.2%
if -1.08e-58 < y < -1.3e-133 or 6.80000000000000017e-140 < y < 1.99999999999999999e-55Initial program 99.9%
Taylor expanded in y around 0 72.4%
+-commutative72.4%
*-commutative72.4%
distribute-rgt-in72.4%
Simplified72.4%
Taylor expanded in x around inf 50.6%
Final simplification66.9%
(FPCore (x y z)
:precision binary64
(if (<= y -2.3e+94)
(* x y)
(if (<= y -1.08e-58)
(* z 5.0)
(if (<= y -8.4e-138)
(* z x)
(if (<= y 6.8e-140)
(* z 5.0)
(if (<= y 1.2e-55) (* z x) (if (<= y 7e-43) (/ z 0.2) (* x y))))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.3e+94) {
tmp = x * y;
} else if (y <= -1.08e-58) {
tmp = z * 5.0;
} else if (y <= -8.4e-138) {
tmp = z * x;
} else if (y <= 6.8e-140) {
tmp = z * 5.0;
} else if (y <= 1.2e-55) {
tmp = z * x;
} else if (y <= 7e-43) {
tmp = z / 0.2;
} else {
tmp = x * 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 (y <= (-2.3d+94)) then
tmp = x * y
else if (y <= (-1.08d-58)) then
tmp = z * 5.0d0
else if (y <= (-8.4d-138)) then
tmp = z * x
else if (y <= 6.8d-140) then
tmp = z * 5.0d0
else if (y <= 1.2d-55) then
tmp = z * x
else if (y <= 7d-43) then
tmp = z / 0.2d0
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.3e+94) {
tmp = x * y;
} else if (y <= -1.08e-58) {
tmp = z * 5.0;
} else if (y <= -8.4e-138) {
tmp = z * x;
} else if (y <= 6.8e-140) {
tmp = z * 5.0;
} else if (y <= 1.2e-55) {
tmp = z * x;
} else if (y <= 7e-43) {
tmp = z / 0.2;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.3e+94: tmp = x * y elif y <= -1.08e-58: tmp = z * 5.0 elif y <= -8.4e-138: tmp = z * x elif y <= 6.8e-140: tmp = z * 5.0 elif y <= 1.2e-55: tmp = z * x elif y <= 7e-43: tmp = z / 0.2 else: tmp = x * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.3e+94) tmp = Float64(x * y); elseif (y <= -1.08e-58) tmp = Float64(z * 5.0); elseif (y <= -8.4e-138) tmp = Float64(z * x); elseif (y <= 6.8e-140) tmp = Float64(z * 5.0); elseif (y <= 1.2e-55) tmp = Float64(z * x); elseif (y <= 7e-43) tmp = Float64(z / 0.2); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.3e+94) tmp = x * y; elseif (y <= -1.08e-58) tmp = z * 5.0; elseif (y <= -8.4e-138) tmp = z * x; elseif (y <= 6.8e-140) tmp = z * 5.0; elseif (y <= 1.2e-55) tmp = z * x; elseif (y <= 7e-43) tmp = z / 0.2; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.3e+94], N[(x * y), $MachinePrecision], If[LessEqual[y, -1.08e-58], N[(z * 5.0), $MachinePrecision], If[LessEqual[y, -8.4e-138], N[(z * x), $MachinePrecision], If[LessEqual[y, 6.8e-140], N[(z * 5.0), $MachinePrecision], If[LessEqual[y, 1.2e-55], N[(z * x), $MachinePrecision], If[LessEqual[y, 7e-43], N[(z / 0.2), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+94}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -1.08 \cdot 10^{-58}:\\
\;\;\;\;z \cdot 5\\
\mathbf{elif}\;y \leq -8.4 \cdot 10^{-138}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-140}:\\
\;\;\;\;z \cdot 5\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-55}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-43}:\\
\;\;\;\;\frac{z}{0.2}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -2.3e94 or 6.99999999999999994e-43 < y Initial program 100.0%
Taylor expanded in y around inf 85.3%
if -2.3e94 < y < -1.08e-58 or -8.39999999999999943e-138 < y < 6.80000000000000017e-140Initial program 99.9%
Taylor expanded in x around 0 51.4%
if -1.08e-58 < y < -8.39999999999999943e-138 or 6.80000000000000017e-140 < y < 1.19999999999999996e-55Initial program 99.9%
Taylor expanded in y around 0 72.4%
+-commutative72.4%
*-commutative72.4%
distribute-rgt-in72.4%
Simplified72.4%
Taylor expanded in x around inf 50.6%
if 1.19999999999999996e-55 < y < 6.99999999999999994e-43Initial program 99.6%
Taylor expanded in y around 0 99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-in99.6%
Simplified99.6%
flip-+99.6%
associate-*r/99.6%
metadata-eval99.6%
Applied egg-rr99.6%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification66.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.3e+94) (not (<= y 8e-139))) (* x (+ z y)) (* z (+ 5.0 x))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.3e+94) || !(y <= 8e-139)) {
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 ((y <= (-2.3d+94)) .or. (.not. (y <= 8d-139))) 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 ((y <= -2.3e+94) || !(y <= 8e-139)) {
tmp = x * (z + y);
} else {
tmp = z * (5.0 + x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.3e+94) or not (y <= 8e-139): tmp = x * (z + y) else: tmp = z * (5.0 + x) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.3e+94) || !(y <= 8e-139)) 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 ((y <= -2.3e+94) || ~((y <= 8e-139))) tmp = x * (z + y); else tmp = z * (5.0 + x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.3e+94], N[Not[LessEqual[y, 8e-139]], $MachinePrecision]], N[(x * N[(z + y), $MachinePrecision]), $MachinePrecision], N[(z * N[(5.0 + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+94} \lor \neg \left(y \leq 8 \cdot 10^{-139}\right):\\
\;\;\;\;x \cdot \left(z + y\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(5 + x\right)\\
\end{array}
\end{array}
if y < -2.3e94 or 8.00000000000000024e-139 < y Initial program 100.0%
Taylor expanded in x around inf 88.3%
+-commutative88.3%
Simplified88.3%
if -2.3e94 < y < 8.00000000000000024e-139Initial program 99.8%
Taylor expanded in y around 0 81.8%
+-commutative81.8%
*-commutative81.8%
distribute-rgt-in81.8%
Simplified81.8%
Final simplification85.1%
(FPCore (x y z) :precision binary64 (if (<= y -7e+94) (* x y) (if (<= y 2e-41) (* z (+ 5.0 x)) (* x y))))
double code(double x, double y, double z) {
double tmp;
if (y <= -7e+94) {
tmp = x * y;
} else if (y <= 2e-41) {
tmp = z * (5.0 + x);
} else {
tmp = x * 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 (y <= (-7d+94)) then
tmp = x * y
else if (y <= 2d-41) then
tmp = z * (5.0d0 + x)
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -7e+94) {
tmp = x * y;
} else if (y <= 2e-41) {
tmp = z * (5.0 + x);
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -7e+94: tmp = x * y elif y <= 2e-41: tmp = z * (5.0 + x) else: tmp = x * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -7e+94) tmp = Float64(x * y); elseif (y <= 2e-41) tmp = Float64(z * Float64(5.0 + x)); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -7e+94) tmp = x * y; elseif (y <= 2e-41) tmp = z * (5.0 + x); else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7e+94], N[(x * y), $MachinePrecision], If[LessEqual[y, 2e-41], N[(z * N[(5.0 + x), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+94}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-41}:\\
\;\;\;\;z \cdot \left(5 + x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -6.9999999999999994e94 or 2.00000000000000001e-41 < y Initial program 100.0%
Taylor expanded in y around inf 85.3%
if -6.9999999999999994e94 < y < 2.00000000000000001e-41Initial program 99.9%
Taylor expanded in y around 0 79.6%
+-commutative79.6%
*-commutative79.6%
distribute-rgt-in79.6%
Simplified79.6%
Final simplification82.1%
(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 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= y -2.3e+94) (* x y) (if (<= y 1.62e-127) (* z 5.0) (* x y))))
double code(double x, double y, double z) {
double tmp;
if (y <= -2.3e+94) {
tmp = x * y;
} else if (y <= 1.62e-127) {
tmp = z * 5.0;
} else {
tmp = x * 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 (y <= (-2.3d+94)) then
tmp = x * y
else if (y <= 1.62d-127) then
tmp = z * 5.0d0
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -2.3e+94) {
tmp = x * y;
} else if (y <= 1.62e-127) {
tmp = z * 5.0;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -2.3e+94: tmp = x * y elif y <= 1.62e-127: tmp = z * 5.0 else: tmp = x * y return tmp
function code(x, y, z) tmp = 0.0 if (y <= -2.3e+94) tmp = Float64(x * y); elseif (y <= 1.62e-127) tmp = Float64(z * 5.0); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -2.3e+94) tmp = x * y; elseif (y <= 1.62e-127) tmp = z * 5.0; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -2.3e+94], N[(x * y), $MachinePrecision], If[LessEqual[y, 1.62e-127], N[(z * 5.0), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+94}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq 1.62 \cdot 10^{-127}:\\
\;\;\;\;z \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if y < -2.3e94 or 1.61999999999999993e-127 < y Initial program 100.0%
Taylor expanded in y around inf 78.6%
if -2.3e94 < y < 1.61999999999999993e-127Initial program 99.9%
Taylor expanded in x around 0 47.9%
Final simplification63.5%
(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 99.9%
Taylor expanded in x around 0 30.7%
Final simplification30.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 2023240
(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)))