
(FPCore (x y z) :precision binary64 (+ (+ (+ (+ (+ x y) y) x) z) x))
double code(double x, double y, double z) {
return ((((x + y) + y) + x) + 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) + y) + x) + z) + x
end function
public static double code(double x, double y, double z) {
return ((((x + y) + y) + x) + z) + x;
}
def code(x, y, z): return ((((x + y) + y) + x) + z) + x
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x + y) + y) + x) + z) + x) end
function tmp = code(x, y, z) tmp = ((((x + y) + y) + x) + z) + x; end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ (+ (+ (+ (+ x y) y) x) z) x))
double code(double x, double y, double z) {
return ((((x + y) + y) + x) + 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) + y) + x) + z) + x
end function
public static double code(double x, double y, double z) {
return ((((x + y) + y) + x) + z) + x;
}
def code(x, y, z): return ((((x + y) + y) + x) + z) + x
function code(x, y, z) return Float64(Float64(Float64(Float64(Float64(x + y) + y) + x) + z) + x) end
function tmp = code(x, y, z) tmp = ((((x + y) + y) + x) + z) + x; end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x + y\right) + y\right) + x\right) + z\right) + x
\end{array}
(FPCore (x y z) :precision binary64 (fma x 3.0 (+ z (* y 2.0))))
double code(double x, double y, double z) {
return fma(x, 3.0, (z + (y * 2.0)));
}
function code(x, y, z) return fma(x, 3.0, Float64(z + Float64(y * 2.0))) end
code[x_, y_, z_] := N[(x * 3.0 + N[(z + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, 3, z + y \cdot 2\right)
\end{array}
Initial program 99.9%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
associate-+r+N/A
+-commutativeN/A
fma-defineN/A
fma-lowering-fma.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64100.0%
Applied egg-rr100.0%
(FPCore (x y z) :precision binary64 (if (<= x -2.6e-45) (+ z (* x 3.0)) (if (<= x 1.7e+135) (+ z (* y 2.0)) (+ (* x 3.0) (* y 2.0)))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.6e-45) {
tmp = z + (x * 3.0);
} else if (x <= 1.7e+135) {
tmp = z + (y * 2.0);
} else {
tmp = (x * 3.0) + (y * 2.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.6d-45)) then
tmp = z + (x * 3.0d0)
else if (x <= 1.7d+135) then
tmp = z + (y * 2.0d0)
else
tmp = (x * 3.0d0) + (y * 2.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -2.6e-45) {
tmp = z + (x * 3.0);
} else if (x <= 1.7e+135) {
tmp = z + (y * 2.0);
} else {
tmp = (x * 3.0) + (y * 2.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.6e-45: tmp = z + (x * 3.0) elif x <= 1.7e+135: tmp = z + (y * 2.0) else: tmp = (x * 3.0) + (y * 2.0) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.6e-45) tmp = Float64(z + Float64(x * 3.0)); elseif (x <= 1.7e+135) tmp = Float64(z + Float64(y * 2.0)); else tmp = Float64(Float64(x * 3.0) + Float64(y * 2.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -2.6e-45) tmp = z + (x * 3.0); elseif (x <= 1.7e+135) tmp = z + (y * 2.0); else tmp = (x * 3.0) + (y * 2.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.6e-45], N[(z + N[(x * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.7e+135], N[(z + N[(y * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 3.0), $MachinePrecision] + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-45}:\\
\;\;\;\;z + x \cdot 3\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+135}:\\
\;\;\;\;z + y \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 3 + y \cdot 2\\
\end{array}
\end{array}
if x < -2.59999999999999987e-45Initial program 99.9%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f6483.9%
Simplified83.9%
if -2.59999999999999987e-45 < x < 1.70000000000000005e135Initial program 100.0%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f6492.1%
Simplified92.1%
if 1.70000000000000005e135 < x Initial program 99.8%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6495.3%
Simplified95.3%
Final simplification90.3%
(FPCore (x y z) :precision binary64 (let* ((t_0 (+ z (* x 3.0)))) (if (<= x -8.8e-46) t_0 (if (<= x 1.05e+157) (+ z (* y 2.0)) t_0))))
double code(double x, double y, double z) {
double t_0 = z + (x * 3.0);
double tmp;
if (x <= -8.8e-46) {
tmp = t_0;
} else if (x <= 1.05e+157) {
tmp = z + (y * 2.0);
} 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 = z + (x * 3.0d0)
if (x <= (-8.8d-46)) then
tmp = t_0
else if (x <= 1.05d+157) then
tmp = z + (y * 2.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z + (x * 3.0);
double tmp;
if (x <= -8.8e-46) {
tmp = t_0;
} else if (x <= 1.05e+157) {
tmp = z + (y * 2.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z + (x * 3.0) tmp = 0 if x <= -8.8e-46: tmp = t_0 elif x <= 1.05e+157: tmp = z + (y * 2.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z + Float64(x * 3.0)) tmp = 0.0 if (x <= -8.8e-46) tmp = t_0; elseif (x <= 1.05e+157) tmp = Float64(z + Float64(y * 2.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z + (x * 3.0); tmp = 0.0; if (x <= -8.8e-46) tmp = t_0; elseif (x <= 1.05e+157) tmp = z + (y * 2.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z + N[(x * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.8e-46], t$95$0, If[LessEqual[x, 1.05e+157], N[(z + N[(y * 2.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z + x \cdot 3\\
\mathbf{if}\;x \leq -8.8 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+157}:\\
\;\;\;\;z + y \cdot 2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -8.8000000000000004e-46 or 1.05e157 < x Initial program 99.9%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f6483.4%
Simplified83.4%
if -8.8000000000000004e-46 < x < 1.05e157Initial program 100.0%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f6491.1%
Simplified91.1%
Final simplification88.2%
(FPCore (x y z) :precision binary64 (if (<= x -5.4e+141) (* x 3.0) (if (<= x 1.25e+157) (+ z (* y 2.0)) (* x 3.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.4e+141) {
tmp = x * 3.0;
} else if (x <= 1.25e+157) {
tmp = z + (y * 2.0);
} else {
tmp = x * 3.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 <= (-5.4d+141)) then
tmp = x * 3.0d0
else if (x <= 1.25d+157) then
tmp = z + (y * 2.0d0)
else
tmp = x * 3.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5.4e+141) {
tmp = x * 3.0;
} else if (x <= 1.25e+157) {
tmp = z + (y * 2.0);
} else {
tmp = x * 3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.4e+141: tmp = x * 3.0 elif x <= 1.25e+157: tmp = z + (y * 2.0) else: tmp = x * 3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.4e+141) tmp = Float64(x * 3.0); elseif (x <= 1.25e+157) tmp = Float64(z + Float64(y * 2.0)); else tmp = Float64(x * 3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5.4e+141) tmp = x * 3.0; elseif (x <= 1.25e+157) tmp = z + (y * 2.0); else tmp = x * 3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.4e+141], N[(x * 3.0), $MachinePrecision], If[LessEqual[x, 1.25e+157], N[(z + N[(y * 2.0), $MachinePrecision]), $MachinePrecision], N[(x * 3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{+141}:\\
\;\;\;\;x \cdot 3\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+157}:\\
\;\;\;\;z + y \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 3\\
\end{array}
\end{array}
if x < -5.4000000000000002e141 or 1.24999999999999994e157 < x Initial program 99.8%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf
*-lowering-*.f6474.4%
Simplified74.4%
if -5.4000000000000002e141 < x < 1.24999999999999994e157Initial program 100.0%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f6487.6%
Simplified87.6%
Final simplification84.4%
(FPCore (x y z) :precision binary64 (if (<= z -1.22e+57) (+ x z) (if (<= z 3.3e+103) (+ x (* y 2.0)) (+ x z))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.22e+57) {
tmp = x + z;
} else if (z <= 3.3e+103) {
tmp = x + (y * 2.0);
} 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 (z <= (-1.22d+57)) then
tmp = x + z
else if (z <= 3.3d+103) then
tmp = x + (y * 2.0d0)
else
tmp = x + z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.22e+57) {
tmp = x + z;
} else if (z <= 3.3e+103) {
tmp = x + (y * 2.0);
} else {
tmp = x + z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.22e+57: tmp = x + z elif z <= 3.3e+103: tmp = x + (y * 2.0) else: tmp = x + z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.22e+57) tmp = Float64(x + z); elseif (z <= 3.3e+103) tmp = Float64(x + Float64(y * 2.0)); else tmp = Float64(x + z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.22e+57) tmp = x + z; elseif (z <= 3.3e+103) tmp = x + (y * 2.0); else tmp = x + z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.22e+57], N[(x + z), $MachinePrecision], If[LessEqual[z, 3.3e+103], N[(x + N[(y * 2.0), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+57}:\\
\;\;\;\;x + z\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+103}:\\
\;\;\;\;x + y \cdot 2\\
\mathbf{else}:\\
\;\;\;\;x + z\\
\end{array}
\end{array}
if z < -1.22e57 or 3.30000000000000009e103 < z Initial program 100.0%
Taylor expanded in z around inf
Simplified73.5%
if -1.22e57 < z < 3.30000000000000009e103Initial program 99.9%
Taylor expanded in y around inf
*-lowering-*.f6455.9%
Simplified55.9%
Final simplification63.4%
(FPCore (x y z) :precision binary64 (if (<= y -9e+25) (* y 2.0) (if (<= y 3.6e+102) (+ x z) (* y 2.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -9e+25) {
tmp = y * 2.0;
} else if (y <= 3.6e+102) {
tmp = x + z;
} else {
tmp = y * 2.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 (y <= (-9d+25)) then
tmp = y * 2.0d0
else if (y <= 3.6d+102) then
tmp = x + z
else
tmp = y * 2.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -9e+25) {
tmp = y * 2.0;
} else if (y <= 3.6e+102) {
tmp = x + z;
} else {
tmp = y * 2.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -9e+25: tmp = y * 2.0 elif y <= 3.6e+102: tmp = x + z else: tmp = y * 2.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -9e+25) tmp = Float64(y * 2.0); elseif (y <= 3.6e+102) tmp = Float64(x + z); else tmp = Float64(y * 2.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -9e+25) tmp = y * 2.0; elseif (y <= 3.6e+102) tmp = x + z; else tmp = y * 2.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -9e+25], N[(y * 2.0), $MachinePrecision], If[LessEqual[y, 3.6e+102], N[(x + z), $MachinePrecision], N[(y * 2.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+25}:\\
\;\;\;\;y \cdot 2\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+102}:\\
\;\;\;\;x + z\\
\mathbf{else}:\\
\;\;\;\;y \cdot 2\\
\end{array}
\end{array}
if y < -9.0000000000000006e25 or 3.6000000000000002e102 < y Initial program 99.9%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf
*-lowering-*.f6466.3%
Simplified66.3%
if -9.0000000000000006e25 < y < 3.6000000000000002e102Initial program 99.9%
Taylor expanded in z around inf
Simplified56.7%
Final simplification60.8%
(FPCore (x y z) :precision binary64 (if (<= z -3e+55) z (if (<= z 8e+23) (* y 2.0) z)))
double code(double x, double y, double z) {
double tmp;
if (z <= -3e+55) {
tmp = z;
} else if (z <= 8e+23) {
tmp = y * 2.0;
} else {
tmp = 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 (z <= (-3d+55)) then
tmp = z
else if (z <= 8d+23) then
tmp = y * 2.0d0
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -3e+55) {
tmp = z;
} else if (z <= 8e+23) {
tmp = y * 2.0;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -3e+55: tmp = z elif z <= 8e+23: tmp = y * 2.0 else: tmp = z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -3e+55) tmp = z; elseif (z <= 8e+23) tmp = Float64(y * 2.0); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -3e+55) tmp = z; elseif (z <= 8e+23) tmp = y * 2.0; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -3e+55], z, If[LessEqual[z, 8e+23], N[(y * 2.0), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+55}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+23}:\\
\;\;\;\;y \cdot 2\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < -3.00000000000000017e55 or 7.9999999999999993e23 < z Initial program 99.9%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf
Simplified67.2%
if -3.00000000000000017e55 < z < 7.9999999999999993e23Initial program 99.9%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f6452.1%
Simplified52.1%
Final simplification59.4%
(FPCore (x y z) :precision binary64 (+ z (+ (* x 3.0) (* y 2.0))))
double code(double x, double y, double z) {
return z + ((x * 3.0) + (y * 2.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 + ((x * 3.0d0) + (y * 2.0d0))
end function
public static double code(double x, double y, double z) {
return z + ((x * 3.0) + (y * 2.0));
}
def code(x, y, z): return z + ((x * 3.0) + (y * 2.0))
function code(x, y, z) return Float64(z + Float64(Float64(x * 3.0) + Float64(y * 2.0))) end
function tmp = code(x, y, z) tmp = z + ((x * 3.0) + (y * 2.0)); end
code[x_, y_, z_] := N[(z + N[(N[(x * 3.0), $MachinePrecision] + N[(y * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z + \left(x \cdot 3 + y \cdot 2\right)
\end{array}
Initial program 99.9%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 z)
double code(double x, double y, double z) {
return z;
}
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
public static double code(double x, double y, double z) {
return z;
}
def code(x, y, z): return z
function code(x, y, z) return z end
function tmp = code(x, y, z) tmp = z; end
code[x_, y_, z_] := z
\begin{array}{l}
\\
z
\end{array}
Initial program 99.9%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
+-lowering-+.f64N/A
count-2N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
distribute-rgt1-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf
Simplified38.3%
(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 99.9%
Taylor expanded in y around inf
*-lowering-*.f6440.0%
Simplified40.0%
Taylor expanded in y around 0
Simplified7.1%
herbie shell --seed 2024161
(FPCore (x y z)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendInside from plot-0.2.3.4"
:precision binary64
(+ (+ (+ (+ (+ x y) y) x) z) x))