
(FPCore (x y z) :precision binary64 (- (* (* x 3.0) y) z))
double code(double x, double y, double z) {
return ((x * 3.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 * 3.0d0) * y) - z
end function
public static double code(double x, double y, double z) {
return ((x * 3.0) * y) - z;
}
def code(x, y, z): return ((x * 3.0) * y) - z
function code(x, y, z) return Float64(Float64(Float64(x * 3.0) * y) - z) end
function tmp = code(x, y, z) tmp = ((x * 3.0) * y) - z; end
code[x_, y_, z_] := N[(N[(N[(x * 3.0), $MachinePrecision] * y), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 3\right) \cdot y - z
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (- (* (* x 3.0) y) z))
double code(double x, double y, double z) {
return ((x * 3.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 * 3.0d0) * y) - z
end function
public static double code(double x, double y, double z) {
return ((x * 3.0) * y) - z;
}
def code(x, y, z): return ((x * 3.0) * y) - z
function code(x, y, z) return Float64(Float64(Float64(x * 3.0) * y) - z) end
function tmp = code(x, y, z) tmp = ((x * 3.0) * y) - z; end
code[x_, y_, z_] := N[(N[(N[(x * 3.0), $MachinePrecision] * y), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 3\right) \cdot y - z
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (fma x (* 3.0 y) (- z)))
assert(x < y);
double code(double x, double y, double z) {
return fma(x, (3.0 * y), -z);
}
x, y = sort([x, y]) function code(x, y, z) return fma(x, Float64(3.0 * y), Float64(-z)) end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(x * N[(3.0 * y), $MachinePrecision] + (-z)), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\mathsf{fma}\left(x, 3 \cdot y, -z\right)
\end{array}
Initial program 99.9%
associate-*l*99.8%
fma-neg99.8%
Simplified99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(if (or (<= y -6.3e-36)
(and (not (<= y 1.1e-29)) (or (<= y 0.00062) (not (<= y 5.2e+58)))))
(* y (* x 3.0))
(- z)))assert(x < y);
double code(double x, double y, double z) {
double tmp;
if ((y <= -6.3e-36) || (!(y <= 1.1e-29) && ((y <= 0.00062) || !(y <= 5.2e+58)))) {
tmp = y * (x * 3.0);
} else {
tmp = -z;
}
return tmp;
}
NOTE: x and y 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 <= (-6.3d-36)) .or. (.not. (y <= 1.1d-29)) .and. (y <= 0.00062d0) .or. (.not. (y <= 5.2d+58))) then
tmp = y * (x * 3.0d0)
else
tmp = -z
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -6.3e-36) || (!(y <= 1.1e-29) && ((y <= 0.00062) || !(y <= 5.2e+58)))) {
tmp = y * (x * 3.0);
} else {
tmp = -z;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if (y <= -6.3e-36) or (not (y <= 1.1e-29) and ((y <= 0.00062) or not (y <= 5.2e+58))): tmp = y * (x * 3.0) else: tmp = -z return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if ((y <= -6.3e-36) || (!(y <= 1.1e-29) && ((y <= 0.00062) || !(y <= 5.2e+58)))) tmp = Float64(y * Float64(x * 3.0)); else tmp = Float64(-z); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((y <= -6.3e-36) || (~((y <= 1.1e-29)) && ((y <= 0.00062) || ~((y <= 5.2e+58)))))
tmp = y * (x * 3.0);
else
tmp = -z;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[Or[LessEqual[y, -6.3e-36], And[N[Not[LessEqual[y, 1.1e-29]], $MachinePrecision], Or[LessEqual[y, 0.00062], N[Not[LessEqual[y, 5.2e+58]], $MachinePrecision]]]], N[(y * N[(x * 3.0), $MachinePrecision]), $MachinePrecision], (-z)]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.3 \cdot 10^{-36} \lor \neg \left(y \leq 1.1 \cdot 10^{-29}\right) \land \left(y \leq 0.00062 \lor \neg \left(y \leq 5.2 \cdot 10^{+58}\right)\right):\\
\;\;\;\;y \cdot \left(x \cdot 3\right)\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if y < -6.299999999999999e-36 or 1.09999999999999995e-29 < y < 6.2e-4 or 5.19999999999999976e58 < y Initial program 99.8%
add-cbrt-cube49.7%
pow349.7%
*-commutative49.7%
associate-*l*49.7%
fma-neg49.7%
add-sqr-sqrt24.5%
sqrt-unprod40.5%
sqr-neg40.5%
sqrt-unprod19.6%
add-sqr-sqrt37.9%
Applied egg-rr37.9%
Taylor expanded in x around inf 29.2%
associate-*r*29.2%
metadata-eval29.2%
cube-prod29.2%
*-commutative29.2%
cube-prod38.6%
associate-*r*38.6%
*-commutative38.6%
Simplified38.6%
rem-cbrt-cube67.1%
Applied egg-rr67.1%
if -6.299999999999999e-36 < y < 1.09999999999999995e-29 or 6.2e-4 < y < 5.19999999999999976e58Initial program 99.9%
Taylor expanded in x around 0 70.6%
mul-1-neg70.6%
Simplified70.6%
Final simplification68.9%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* x 3.0))))
(if (<= y -7.5e-39)
t_0
(if (<= y 2.25e-29)
(- z)
(if (<= y 8e-5) t_0 (if (<= y 7.2e+58) (- z) (* 3.0 (* x y))))))))assert(x < y);
double code(double x, double y, double z) {
double t_0 = y * (x * 3.0);
double tmp;
if (y <= -7.5e-39) {
tmp = t_0;
} else if (y <= 2.25e-29) {
tmp = -z;
} else if (y <= 8e-5) {
tmp = t_0;
} else if (y <= 7.2e+58) {
tmp = -z;
} else {
tmp = 3.0 * (x * y);
}
return tmp;
}
NOTE: x and y 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 = y * (x * 3.0d0)
if (y <= (-7.5d-39)) then
tmp = t_0
else if (y <= 2.25d-29) then
tmp = -z
else if (y <= 8d-5) then
tmp = t_0
else if (y <= 7.2d+58) then
tmp = -z
else
tmp = 3.0d0 * (x * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double t_0 = y * (x * 3.0);
double tmp;
if (y <= -7.5e-39) {
tmp = t_0;
} else if (y <= 2.25e-29) {
tmp = -z;
} else if (y <= 8e-5) {
tmp = t_0;
} else if (y <= 7.2e+58) {
tmp = -z;
} else {
tmp = 3.0 * (x * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): t_0 = y * (x * 3.0) tmp = 0 if y <= -7.5e-39: tmp = t_0 elif y <= 2.25e-29: tmp = -z elif y <= 8e-5: tmp = t_0 elif y <= 7.2e+58: tmp = -z else: tmp = 3.0 * (x * y) return tmp
x, y = sort([x, y]) function code(x, y, z) t_0 = Float64(y * Float64(x * 3.0)) tmp = 0.0 if (y <= -7.5e-39) tmp = t_0; elseif (y <= 2.25e-29) tmp = Float64(-z); elseif (y <= 8e-5) tmp = t_0; elseif (y <= 7.2e+58) tmp = Float64(-z); else tmp = Float64(3.0 * Float64(x * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
t_0 = y * (x * 3.0);
tmp = 0.0;
if (y <= -7.5e-39)
tmp = t_0;
elseif (y <= 2.25e-29)
tmp = -z;
elseif (y <= 8e-5)
tmp = t_0;
elseif (y <= 7.2e+58)
tmp = -z;
else
tmp = 3.0 * (x * y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.5e-39], t$95$0, If[LessEqual[y, 2.25e-29], (-z), If[LessEqual[y, 8e-5], t$95$0, If[LessEqual[y, 7.2e+58], (-z), N[(3.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y \cdot \left(x \cdot 3\right)\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{-39}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{-29}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+58}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if y < -7.49999999999999971e-39 or 2.2499999999999999e-29 < y < 8.00000000000000065e-5Initial program 99.9%
add-cbrt-cube42.3%
pow342.4%
*-commutative42.4%
associate-*l*42.4%
fma-neg42.4%
add-sqr-sqrt20.7%
sqrt-unprod32.1%
sqr-neg32.1%
sqrt-unprod15.8%
add-sqr-sqrt32.2%
Applied egg-rr32.2%
Taylor expanded in x around inf 26.2%
associate-*r*26.3%
metadata-eval26.3%
cube-prod26.3%
*-commutative26.3%
cube-prod32.9%
associate-*r*32.9%
*-commutative32.9%
Simplified32.9%
rem-cbrt-cube64.0%
Applied egg-rr64.0%
if -7.49999999999999971e-39 < y < 2.2499999999999999e-29 or 8.00000000000000065e-5 < y < 7.19999999999999993e58Initial program 99.9%
Taylor expanded in x around 0 70.4%
mul-1-neg70.4%
Simplified70.4%
if 7.19999999999999993e58 < y Initial program 99.8%
add-cbrt-cube61.5%
pow361.5%
*-commutative61.5%
associate-*l*61.5%
fma-neg61.5%
add-sqr-sqrt30.7%
sqrt-unprod54.3%
sqr-neg54.3%
sqrt-unprod26.0%
add-sqr-sqrt47.0%
Applied egg-rr47.0%
Taylor expanded in x around inf 33.7%
associate-*r*33.7%
metadata-eval33.7%
cube-prod33.8%
*-commutative33.8%
cube-prod47.9%
associate-*r*48.0%
*-commutative48.0%
Simplified48.0%
rem-cbrt-cube71.1%
associate-*l*71.0%
*-commutative71.0%
Applied egg-rr71.0%
Final simplification68.5%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z)
:precision binary64
(if (<= y -1.5e-40)
(* y (* x 3.0))
(if (<= y 8e-50)
(- z)
(if (<= y 0.005)
(* x (* 3.0 y))
(if (<= y 8e+59) (- z) (* 3.0 (* x y)))))))assert(x < y);
double code(double x, double y, double z) {
double tmp;
if (y <= -1.5e-40) {
tmp = y * (x * 3.0);
} else if (y <= 8e-50) {
tmp = -z;
} else if (y <= 0.005) {
tmp = x * (3.0 * y);
} else if (y <= 8e+59) {
tmp = -z;
} else {
tmp = 3.0 * (x * y);
}
return tmp;
}
NOTE: x and y 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.5d-40)) then
tmp = y * (x * 3.0d0)
else if (y <= 8d-50) then
tmp = -z
else if (y <= 0.005d0) then
tmp = x * (3.0d0 * y)
else if (y <= 8d+59) then
tmp = -z
else
tmp = 3.0d0 * (x * y)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.5e-40) {
tmp = y * (x * 3.0);
} else if (y <= 8e-50) {
tmp = -z;
} else if (y <= 0.005) {
tmp = x * (3.0 * y);
} else if (y <= 8e+59) {
tmp = -z;
} else {
tmp = 3.0 * (x * y);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z): tmp = 0 if y <= -1.5e-40: tmp = y * (x * 3.0) elif y <= 8e-50: tmp = -z elif y <= 0.005: tmp = x * (3.0 * y) elif y <= 8e+59: tmp = -z else: tmp = 3.0 * (x * y) return tmp
x, y = sort([x, y]) function code(x, y, z) tmp = 0.0 if (y <= -1.5e-40) tmp = Float64(y * Float64(x * 3.0)); elseif (y <= 8e-50) tmp = Float64(-z); elseif (y <= 0.005) tmp = Float64(x * Float64(3.0 * y)); elseif (y <= 8e+59) tmp = Float64(-z); else tmp = Float64(3.0 * Float64(x * y)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -1.5e-40)
tmp = y * (x * 3.0);
elseif (y <= 8e-50)
tmp = -z;
elseif (y <= 0.005)
tmp = x * (3.0 * y);
elseif (y <= 8e+59)
tmp = -z;
else
tmp = 3.0 * (x * y);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, -1.5e-40], N[(y * N[(x * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e-50], (-z), If[LessEqual[y, 0.005], N[(x * N[(3.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+59], (-z), N[(3.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{-40}:\\
\;\;\;\;y \cdot \left(x \cdot 3\right)\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-50}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 0.005:\\
\;\;\;\;x \cdot \left(3 \cdot y\right)\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+59}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;3 \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if y < -1.5000000000000001e-40Initial program 99.9%
add-cbrt-cube43.4%
pow343.4%
*-commutative43.4%
associate-*l*43.4%
fma-neg43.4%
add-sqr-sqrt19.7%
sqrt-unprod32.2%
sqr-neg32.2%
sqrt-unprod17.2%
add-sqr-sqrt33.6%
Applied egg-rr33.6%
Taylor expanded in x around inf 27.0%
associate-*r*27.0%
metadata-eval27.0%
cube-prod27.0%
*-commutative27.0%
cube-prod34.3%
associate-*r*34.3%
*-commutative34.3%
Simplified34.3%
rem-cbrt-cube63.1%
Applied egg-rr63.1%
if -1.5000000000000001e-40 < y < 8.00000000000000006e-50 or 0.0050000000000000001 < y < 7.99999999999999977e59Initial program 99.9%
Taylor expanded in x around 0 71.2%
mul-1-neg71.2%
Simplified71.2%
if 8.00000000000000006e-50 < y < 0.0050000000000000001Initial program 99.5%
add-cbrt-cube24.8%
pow324.9%
*-commutative24.9%
associate-*l*24.9%
fma-neg24.9%
add-sqr-sqrt23.3%
sqrt-unprod24.2%
sqr-neg24.2%
sqrt-unprod1.5%
add-sqr-sqrt14.0%
Applied egg-rr14.0%
Taylor expanded in x around inf 14.1%
associate-*r*14.3%
metadata-eval14.3%
cube-prod14.3%
*-commutative14.3%
cube-prod14.3%
associate-*r*14.3%
*-commutative14.3%
Simplified14.3%
rem-cbrt-cube70.4%
*-commutative70.4%
associate-*r*70.9%
Applied egg-rr70.9%
if 7.99999999999999977e59 < y Initial program 99.8%
add-cbrt-cube61.5%
pow361.5%
*-commutative61.5%
associate-*l*61.5%
fma-neg61.5%
add-sqr-sqrt30.7%
sqrt-unprod54.3%
sqr-neg54.3%
sqrt-unprod26.0%
add-sqr-sqrt47.0%
Applied egg-rr47.0%
Taylor expanded in x around inf 33.7%
associate-*r*33.7%
metadata-eval33.7%
cube-prod33.8%
*-commutative33.8%
cube-prod47.9%
associate-*r*48.0%
*-commutative48.0%
Simplified48.0%
rem-cbrt-cube71.1%
associate-*l*71.0%
*-commutative71.0%
Applied egg-rr71.0%
Final simplification68.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (- (* 3.0 (* x y)) z))
assert(x < y);
double code(double x, double y, double z) {
return (3.0 * (x * y)) - z;
}
NOTE: x and y 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 = (3.0d0 * (x * y)) - z
end function
assert x < y;
public static double code(double x, double y, double z) {
return (3.0 * (x * y)) - z;
}
[x, y] = sort([x, y]) def code(x, y, z): return (3.0 * (x * y)) - z
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(3.0 * Float64(x * y)) - z) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (3.0 * (x * y)) - z;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(3.0 * N[(x * y), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
3 \cdot \left(x \cdot y\right) - z
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (- (* x (* 3.0 y)) z))
assert(x < y);
double code(double x, double y, double z) {
return (x * (3.0 * y)) - z;
}
NOTE: x and y 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 * (3.0d0 * y)) - z
end function
assert x < y;
public static double code(double x, double y, double z) {
return (x * (3.0 * y)) - z;
}
[x, y] = sort([x, y]) def code(x, y, z): return (x * (3.0 * y)) - z
x, y = sort([x, y]) function code(x, y, z) return Float64(Float64(x * Float64(3.0 * y)) - z) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = (x * (3.0 * y)) - z;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := N[(N[(x * N[(3.0 * y), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x \cdot \left(3 \cdot y\right) - z
\end{array}
Initial program 99.9%
associate-*l*99.8%
fma-neg99.8%
Simplified99.8%
fma-neg99.8%
Applied egg-rr99.8%
Final simplification99.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (- z))
assert(x < y);
double code(double x, double y, double z) {
return -z;
}
NOTE: x and y 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 = -z
end function
assert x < y;
public static double code(double x, double y, double z) {
return -z;
}
[x, y] = sort([x, y]) def code(x, y, z): return -z
x, y = sort([x, y]) function code(x, y, z) return Float64(-z) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = -z;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := (-z)
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
-z
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 53.2%
mul-1-neg53.2%
Simplified53.2%
Final simplification53.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 z)
assert(x < y);
double code(double x, double y, double z) {
return z;
}
NOTE: x and y 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 = z
end function
assert x < y;
public static double code(double x, double y, double z) {
return z;
}
[x, y] = sort([x, y]) def code(x, y, z): return z
x, y = sort([x, y]) function code(x, y, z) return z end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z)
tmp = z;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_] := z
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
z
\end{array}
Initial program 99.9%
add-cbrt-cube47.1%
pow347.1%
*-commutative47.1%
associate-*l*47.1%
fma-neg47.1%
add-sqr-sqrt23.7%
sqrt-unprod34.1%
sqr-neg34.1%
sqrt-unprod12.1%
add-sqr-sqrt27.2%
Applied egg-rr27.2%
Taylor expanded in x around 0 2.3%
Final simplification2.3%
(FPCore (x y z) :precision binary64 (- (* x (* 3.0 y)) z))
double code(double x, double y, double z) {
return (x * (3.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 * (3.0d0 * y)) - z
end function
public static double code(double x, double y, double z) {
return (x * (3.0 * y)) - z;
}
def code(x, y, z): return (x * (3.0 * y)) - z
function code(x, y, z) return Float64(Float64(x * Float64(3.0 * y)) - z) end
function tmp = code(x, y, z) tmp = (x * (3.0 * y)) - z; end
code[x_, y_, z_] := N[(N[(x * N[(3.0 * y), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(3 \cdot y\right) - z
\end{array}
herbie shell --seed 2023221
(FPCore (x y z)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(- (* x (* 3.0 y)) z)
(- (* (* x 3.0) y) z))