
(FPCore (x y z) :precision binary64 (+ x (* y (+ z x))))
double code(double x, double y, double z) {
return x + (y * (z + x));
}
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 + x))
end function
public static double code(double x, double y, double z) {
return x + (y * (z + x));
}
def code(x, y, z): return x + (y * (z + x))
function code(x, y, z) return Float64(x + Float64(y * Float64(z + x))) end
function tmp = code(x, y, z) tmp = x + (y * (z + x)); end
code[x_, y_, z_] := N[(x + N[(y * N[(z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \left(z + x\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* y (+ z x))))
double code(double x, double y, double z) {
return x + (y * (z + x));
}
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 + x))
end function
public static double code(double x, double y, double z) {
return x + (y * (z + x));
}
def code(x, y, z): return x + (y * (z + x))
function code(x, y, z) return Float64(x + Float64(y * Float64(z + x))) end
function tmp = code(x, y, z) tmp = x + (y * (z + x)); end
code[x_, y_, z_] := N[(x + N[(y * N[(z + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \left(z + x\right)
\end{array}
(FPCore (x y z) :precision binary64 (fma y (+ x z) x))
double code(double x, double y, double z) {
return fma(y, (x + z), x);
}
function code(x, y, z) return fma(y, Float64(x + z), x) end
code[x_, y_, z_] := N[(y * N[(x + z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, x + z, x\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z)
:precision binary64
(if (<= y -3.1e+156)
(* y z)
(if (<= y -4.3e+15)
(* y x)
(if (<= y -1.15e-32)
(* y z)
(if (<= y -4.3e-113)
x
(if (<= y -8.5e-140)
(* y z)
(if (<= y 5.3e-145) x (if (<= y 9.2e+171) (* y z) (* y x)))))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.1e+156) {
tmp = y * z;
} else if (y <= -4.3e+15) {
tmp = y * x;
} else if (y <= -1.15e-32) {
tmp = y * z;
} else if (y <= -4.3e-113) {
tmp = x;
} else if (y <= -8.5e-140) {
tmp = y * z;
} else if (y <= 5.3e-145) {
tmp = x;
} else if (y <= 9.2e+171) {
tmp = y * 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 (y <= (-3.1d+156)) then
tmp = y * z
else if (y <= (-4.3d+15)) then
tmp = y * x
else if (y <= (-1.15d-32)) then
tmp = y * z
else if (y <= (-4.3d-113)) then
tmp = x
else if (y <= (-8.5d-140)) then
tmp = y * z
else if (y <= 5.3d-145) then
tmp = x
else if (y <= 9.2d+171) then
tmp = y * z
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.1e+156) {
tmp = y * z;
} else if (y <= -4.3e+15) {
tmp = y * x;
} else if (y <= -1.15e-32) {
tmp = y * z;
} else if (y <= -4.3e-113) {
tmp = x;
} else if (y <= -8.5e-140) {
tmp = y * z;
} else if (y <= 5.3e-145) {
tmp = x;
} else if (y <= 9.2e+171) {
tmp = y * z;
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.1e+156: tmp = y * z elif y <= -4.3e+15: tmp = y * x elif y <= -1.15e-32: tmp = y * z elif y <= -4.3e-113: tmp = x elif y <= -8.5e-140: tmp = y * z elif y <= 5.3e-145: tmp = x elif y <= 9.2e+171: tmp = y * z else: tmp = y * x return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.1e+156) tmp = Float64(y * z); elseif (y <= -4.3e+15) tmp = Float64(y * x); elseif (y <= -1.15e-32) tmp = Float64(y * z); elseif (y <= -4.3e-113) tmp = x; elseif (y <= -8.5e-140) tmp = Float64(y * z); elseif (y <= 5.3e-145) tmp = x; elseif (y <= 9.2e+171) tmp = Float64(y * z); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.1e+156) tmp = y * z; elseif (y <= -4.3e+15) tmp = y * x; elseif (y <= -1.15e-32) tmp = y * z; elseif (y <= -4.3e-113) tmp = x; elseif (y <= -8.5e-140) tmp = y * z; elseif (y <= 5.3e-145) tmp = x; elseif (y <= 9.2e+171) tmp = y * z; else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.1e+156], N[(y * z), $MachinePrecision], If[LessEqual[y, -4.3e+15], N[(y * x), $MachinePrecision], If[LessEqual[y, -1.15e-32], N[(y * z), $MachinePrecision], If[LessEqual[y, -4.3e-113], x, If[LessEqual[y, -8.5e-140], N[(y * z), $MachinePrecision], If[LessEqual[y, 5.3e-145], x, If[LessEqual[y, 9.2e+171], N[(y * z), $MachinePrecision], N[(y * x), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+156}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -4.3 \cdot 10^{+15}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{-32}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -4.3 \cdot 10^{-113}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{-140}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{-145}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{+171}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if y < -3.1000000000000002e156 or -4.3e15 < y < -1.15e-32 or -4.3e-113 < y < -8.49999999999999997e-140 or 5.29999999999999999e-145 < y < 9.20000000000000069e171Initial program 100.0%
Taylor expanded in z around inf 75.5%
Taylor expanded in x around 0 66.5%
if -3.1000000000000002e156 < y < -4.3e15 or 9.20000000000000069e171 < y Initial program 100.0%
Taylor expanded in x around -inf 93.0%
+-commutative93.0%
mul-1-neg93.0%
unsub-neg93.0%
sub-neg93.0%
metadata-eval93.0%
+-commutative93.0%
mul-1-neg93.0%
unsub-neg93.0%
Simplified93.0%
Taylor expanded in y around inf 100.0%
neg-mul-1100.0%
distribute-lft-out--92.9%
distribute-rgt-neg-in92.9%
distribute-lft-neg-out92.9%
cancel-sign-sub92.9%
distribute-lft-in100.0%
Simplified100.0%
Taylor expanded in z around 0 69.6%
*-commutative69.6%
Simplified69.6%
if -1.15e-32 < y < -4.3e-113 or -8.49999999999999997e-140 < y < 5.29999999999999999e-145Initial program 100.0%
Taylor expanded in y around 0 78.7%
Final simplification71.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (+ x z))))
(if (<= y -1.4e-32)
t_0
(if (<= y -4.5e-113)
x
(if (<= y -9e-140) (* y z) (if (<= y 2.3e-145) x t_0))))))
double code(double x, double y, double z) {
double t_0 = y * (x + z);
double tmp;
if (y <= -1.4e-32) {
tmp = t_0;
} else if (y <= -4.5e-113) {
tmp = x;
} else if (y <= -9e-140) {
tmp = y * z;
} else if (y <= 2.3e-145) {
tmp = x;
} else {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = y * (x + z)
if (y <= (-1.4d-32)) then
tmp = t_0
else if (y <= (-4.5d-113)) then
tmp = x
else if (y <= (-9d-140)) then
tmp = y * z
else if (y <= 2.3d-145) then
tmp = x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x + z);
double tmp;
if (y <= -1.4e-32) {
tmp = t_0;
} else if (y <= -4.5e-113) {
tmp = x;
} else if (y <= -9e-140) {
tmp = y * z;
} else if (y <= 2.3e-145) {
tmp = x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x + z) tmp = 0 if y <= -1.4e-32: tmp = t_0 elif y <= -4.5e-113: tmp = x elif y <= -9e-140: tmp = y * z elif y <= 2.3e-145: tmp = x else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x + z)) tmp = 0.0 if (y <= -1.4e-32) tmp = t_0; elseif (y <= -4.5e-113) tmp = x; elseif (y <= -9e-140) tmp = Float64(y * z); elseif (y <= 2.3e-145) tmp = x; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x + z); tmp = 0.0; if (y <= -1.4e-32) tmp = t_0; elseif (y <= -4.5e-113) tmp = x; elseif (y <= -9e-140) tmp = y * z; elseif (y <= 2.3e-145) tmp = x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.4e-32], t$95$0, If[LessEqual[y, -4.5e-113], x, If[LessEqual[y, -9e-140], N[(y * z), $MachinePrecision], If[LessEqual[y, 2.3e-145], x, t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(x + z\right)\\
\mathbf{if}\;y \leq -1.4 \cdot 10^{-32}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-113}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-140}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-145}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1.3999999999999999e-32 or 2.30000000000000007e-145 < y Initial program 100.0%
Taylor expanded in x around -inf 96.3%
+-commutative96.3%
mul-1-neg96.3%
unsub-neg96.3%
sub-neg96.3%
metadata-eval96.3%
+-commutative96.3%
mul-1-neg96.3%
unsub-neg96.3%
Simplified96.3%
Taylor expanded in y around inf 94.3%
neg-mul-194.3%
distribute-lft-out--90.7%
distribute-rgt-neg-in90.7%
distribute-lft-neg-out90.7%
cancel-sign-sub90.7%
distribute-lft-in94.3%
Simplified94.3%
if -1.3999999999999999e-32 < y < -4.5000000000000001e-113 or -9.00000000000000008e-140 < y < 2.30000000000000007e-145Initial program 100.0%
Taylor expanded in y around 0 78.7%
if -4.5000000000000001e-113 < y < -9.00000000000000008e-140Initial program 100.0%
Taylor expanded in z around inf 100.0%
Taylor expanded in x around 0 85.9%
Final simplification88.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (+ x z))) (t_1 (+ x (* y x))))
(if (<= y -1.25e-32)
t_0
(if (<= y -5.8e-113)
t_1
(if (<= y -9e-140) (* y z) (if (<= y 5.3e-145) t_1 t_0))))))
double code(double x, double y, double z) {
double t_0 = y * (x + z);
double t_1 = x + (y * x);
double tmp;
if (y <= -1.25e-32) {
tmp = t_0;
} else if (y <= -5.8e-113) {
tmp = t_1;
} else if (y <= -9e-140) {
tmp = y * z;
} else if (y <= 5.3e-145) {
tmp = t_1;
} else {
tmp = t_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y * (x + z)
t_1 = x + (y * x)
if (y <= (-1.25d-32)) then
tmp = t_0
else if (y <= (-5.8d-113)) then
tmp = t_1
else if (y <= (-9d-140)) then
tmp = y * z
else if (y <= 5.3d-145) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x + z);
double t_1 = x + (y * x);
double tmp;
if (y <= -1.25e-32) {
tmp = t_0;
} else if (y <= -5.8e-113) {
tmp = t_1;
} else if (y <= -9e-140) {
tmp = y * z;
} else if (y <= 5.3e-145) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x + z) t_1 = x + (y * x) tmp = 0 if y <= -1.25e-32: tmp = t_0 elif y <= -5.8e-113: tmp = t_1 elif y <= -9e-140: tmp = y * z elif y <= 5.3e-145: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x + z)) t_1 = Float64(x + Float64(y * x)) tmp = 0.0 if (y <= -1.25e-32) tmp = t_0; elseif (y <= -5.8e-113) tmp = t_1; elseif (y <= -9e-140) tmp = Float64(y * z); elseif (y <= 5.3e-145) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x + z); t_1 = x + (y * x); tmp = 0.0; if (y <= -1.25e-32) tmp = t_0; elseif (y <= -5.8e-113) tmp = t_1; elseif (y <= -9e-140) tmp = y * z; elseif (y <= 5.3e-145) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x + z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(y * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e-32], t$95$0, If[LessEqual[y, -5.8e-113], t$95$1, If[LessEqual[y, -9e-140], N[(y * z), $MachinePrecision], If[LessEqual[y, 5.3e-145], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(x + z\right)\\
t_1 := x + y \cdot x\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{-32}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -5.8 \cdot 10^{-113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-140}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1.25e-32 or 5.29999999999999999e-145 < y Initial program 100.0%
Taylor expanded in x around -inf 96.3%
+-commutative96.3%
mul-1-neg96.3%
unsub-neg96.3%
sub-neg96.3%
metadata-eval96.3%
+-commutative96.3%
mul-1-neg96.3%
unsub-neg96.3%
Simplified96.3%
Taylor expanded in y around inf 94.3%
neg-mul-194.3%
distribute-lft-out--90.7%
distribute-rgt-neg-in90.7%
distribute-lft-neg-out90.7%
cancel-sign-sub90.7%
distribute-lft-in94.3%
Simplified94.3%
if -1.25e-32 < y < -5.80000000000000008e-113 or -9.00000000000000008e-140 < y < 5.29999999999999999e-145Initial program 100.0%
Taylor expanded in z around 0 78.7%
*-commutative3.3%
Simplified78.7%
if -5.80000000000000008e-113 < y < -9.00000000000000008e-140Initial program 100.0%
Taylor expanded in z around inf 100.0%
Taylor expanded in x around 0 85.9%
Final simplification88.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -20500000000000.0) (not (<= y 9.5e-17))) (* y (+ x z)) (+ x (* y z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -20500000000000.0) || !(y <= 9.5e-17)) {
tmp = y * (x + z);
} else {
tmp = x + (y * 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 ((y <= (-20500000000000.0d0)) .or. (.not. (y <= 9.5d-17))) then
tmp = y * (x + z)
else
tmp = x + (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -20500000000000.0) || !(y <= 9.5e-17)) {
tmp = y * (x + z);
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -20500000000000.0) or not (y <= 9.5e-17): tmp = y * (x + z) else: tmp = x + (y * z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -20500000000000.0) || !(y <= 9.5e-17)) tmp = Float64(y * Float64(x + z)); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -20500000000000.0) || ~((y <= 9.5e-17))) tmp = y * (x + z); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -20500000000000.0], N[Not[LessEqual[y, 9.5e-17]], $MachinePrecision]], N[(y * N[(x + z), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -20500000000000 \lor \neg \left(y \leq 9.5 \cdot 10^{-17}\right):\\
\;\;\;\;y \cdot \left(x + z\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if y < -2.05e13 or 9.50000000000000029e-17 < y Initial program 100.0%
Taylor expanded in x around -inf 95.3%
+-commutative95.3%
mul-1-neg95.3%
unsub-neg95.3%
sub-neg95.3%
metadata-eval95.3%
+-commutative95.3%
mul-1-neg95.3%
unsub-neg95.3%
Simplified95.3%
Taylor expanded in y around inf 99.4%
neg-mul-199.4%
distribute-lft-out--94.7%
distribute-rgt-neg-in94.7%
distribute-lft-neg-out94.7%
cancel-sign-sub94.7%
distribute-lft-in99.4%
Simplified99.4%
if -2.05e13 < y < 9.50000000000000029e-17Initial program 100.0%
Taylor expanded in z around inf 99.9%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -4.8e-10) (not (<= y 4.2e-9))) (* y x) x))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.8e-10) || !(y <= 4.2e-9)) {
tmp = y * x;
} else {
tmp = 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 <= (-4.8d-10)) .or. (.not. (y <= 4.2d-9))) then
tmp = y * x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4.8e-10) || !(y <= 4.2e-9)) {
tmp = y * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.8e-10) or not (y <= 4.2e-9): tmp = y * x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.8e-10) || !(y <= 4.2e-9)) tmp = Float64(y * x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4.8e-10) || ~((y <= 4.2e-9))) tmp = y * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.8e-10], N[Not[LessEqual[y, 4.2e-9]], $MachinePrecision]], N[(y * x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-10} \lor \neg \left(y \leq 4.2 \cdot 10^{-9}\right):\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.8e-10 or 4.20000000000000039e-9 < y Initial program 100.0%
Taylor expanded in x around -inf 95.4%
+-commutative95.4%
mul-1-neg95.4%
unsub-neg95.4%
sub-neg95.4%
metadata-eval95.4%
+-commutative95.4%
mul-1-neg95.4%
unsub-neg95.4%
Simplified95.4%
Taylor expanded in y around inf 99.4%
neg-mul-199.4%
distribute-lft-out--94.9%
distribute-rgt-neg-in94.9%
distribute-lft-neg-out94.9%
cancel-sign-sub94.9%
distribute-lft-in99.4%
Simplified99.4%
Taylor expanded in z around 0 51.5%
*-commutative51.5%
Simplified51.5%
if -4.8e-10 < y < 4.20000000000000039e-9Initial program 100.0%
Taylor expanded in y around 0 62.8%
Final simplification57.0%
(FPCore (x y z) :precision binary64 (+ x (* y (+ x z))))
double code(double x, double y, double z) {
return x + (y * (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 + (y * (x + z))
end function
public static double code(double x, double y, double z) {
return x + (y * (x + z));
}
def code(x, y, z): return x + (y * (x + z))
function code(x, y, z) return Float64(x + Float64(y * Float64(x + z))) end
function tmp = code(x, y, z) tmp = x + (y * (x + z)); end
code[x_, y_, z_] := N[(x + N[(y * N[(x + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \left(x + z\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
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
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 100.0%
Taylor expanded in y around 0 32.0%
Final simplification32.0%
herbie shell --seed 2024043
(FPCore (x y z)
:name "Main:bigenough2 from A"
:precision binary64
(+ x (* y (+ z x))))