
(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 8 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 (+ (* 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}
Initial program 99.9%
(FPCore (x y z)
:precision binary64
(if (<= x -5.5e-8)
(* x y)
(if (<= x 3.7e-69)
(* z 5.0)
(if (<= x 2.4e+85) (* x y) (if (<= x 1.12e+135) (* x z) (* x y))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.5e-8) {
tmp = x * y;
} else if (x <= 3.7e-69) {
tmp = z * 5.0;
} else if (x <= 2.4e+85) {
tmp = x * y;
} else if (x <= 1.12e+135) {
tmp = x * z;
} 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 (x <= (-5.5d-8)) then
tmp = x * y
else if (x <= 3.7d-69) then
tmp = z * 5.0d0
else if (x <= 2.4d+85) then
tmp = x * y
else if (x <= 1.12d+135) then
tmp = x * z
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -5.5e-8) {
tmp = x * y;
} else if (x <= 3.7e-69) {
tmp = z * 5.0;
} else if (x <= 2.4e+85) {
tmp = x * y;
} else if (x <= 1.12e+135) {
tmp = x * z;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.5e-8: tmp = x * y elif x <= 3.7e-69: tmp = z * 5.0 elif x <= 2.4e+85: tmp = x * y elif x <= 1.12e+135: tmp = x * z else: tmp = x * y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.5e-8) tmp = Float64(x * y); elseif (x <= 3.7e-69) tmp = Float64(z * 5.0); elseif (x <= 2.4e+85) tmp = Float64(x * y); elseif (x <= 1.12e+135) tmp = Float64(x * z); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5.5e-8) tmp = x * y; elseif (x <= 3.7e-69) tmp = z * 5.0; elseif (x <= 2.4e+85) tmp = x * y; elseif (x <= 1.12e+135) tmp = x * z; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.5e-8], N[(x * y), $MachinePrecision], If[LessEqual[x, 3.7e-69], N[(z * 5.0), $MachinePrecision], If[LessEqual[x, 2.4e+85], N[(x * y), $MachinePrecision], If[LessEqual[x, 1.12e+135], N[(x * z), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{-8}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{-69}:\\
\;\;\;\;z \cdot 5\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+85}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{+135}:\\
\;\;\;\;x \cdot z\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -5.5000000000000003e-8 or 3.7000000000000002e-69 < x < 2.39999999999999997e85 or 1.1199999999999999e135 < x Initial program 100.0%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6493.8%
Simplified93.8%
Taylor expanded in y around inf
*-lowering-*.f6464.0%
Simplified64.0%
if -5.5000000000000003e-8 < x < 3.7000000000000002e-69Initial program 99.8%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
*-lowering-*.f6478.9%
Simplified78.9%
if 2.39999999999999997e85 < x < 1.1199999999999999e135Initial program 100.0%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Taylor expanded in z around inf
*-commutativeN/A
*-lowering-*.f6491.0%
Simplified91.0%
Final simplification72.0%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* x (+ y z)))) (if (<= x -5.0) t_0 (if (<= x 0.00031) (+ (* x y) (* z 5.0)) t_0))))
double code(double x, double y, double z) {
double t_0 = x * (y + z);
double tmp;
if (x <= -5.0) {
tmp = t_0;
} else if (x <= 0.00031) {
tmp = (x * y) + (z * 5.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 = x * (y + z)
if (x <= (-5.0d0)) then
tmp = t_0
else if (x <= 0.00031d0) then
tmp = (x * y) + (z * 5.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (y + z);
double tmp;
if (x <= -5.0) {
tmp = t_0;
} else if (x <= 0.00031) {
tmp = (x * y) + (z * 5.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y + z) tmp = 0 if x <= -5.0: tmp = t_0 elif x <= 0.00031: tmp = (x * y) + (z * 5.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y + z)) tmp = 0.0 if (x <= -5.0) tmp = t_0; elseif (x <= 0.00031) tmp = Float64(Float64(x * y) + Float64(z * 5.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y + z); tmp = 0.0; if (x <= -5.0) tmp = t_0; elseif (x <= 0.00031) tmp = (x * y) + (z * 5.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.0], t$95$0, If[LessEqual[x, 0.00031], N[(N[(x * y), $MachinePrecision] + N[(z * 5.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(y + z\right)\\
\mathbf{if}\;x \leq -5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 0.00031:\\
\;\;\;\;x \cdot y + z \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -5 or 3.1e-4 < x Initial program 100.0%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6494.0%
Simplified94.0%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6498.9%
Simplified98.9%
if -5 < x < 3.1e-4Initial program 99.8%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
Simplified99.1%
Final simplification99.0%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* x (+ y z)))) (if (<= x -240000000.0) t_0 (if (<= x 2.05e-78) (* z (+ x 5.0)) t_0))))
double code(double x, double y, double z) {
double t_0 = x * (y + z);
double tmp;
if (x <= -240000000.0) {
tmp = t_0;
} else if (x <= 2.05e-78) {
tmp = z * (x + 5.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 = x * (y + z)
if (x <= (-240000000.0d0)) then
tmp = t_0
else if (x <= 2.05d-78) then
tmp = z * (x + 5.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (y + z);
double tmp;
if (x <= -240000000.0) {
tmp = t_0;
} else if (x <= 2.05e-78) {
tmp = z * (x + 5.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y + z) tmp = 0 if x <= -240000000.0: tmp = t_0 elif x <= 2.05e-78: tmp = z * (x + 5.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y + z)) tmp = 0.0 if (x <= -240000000.0) tmp = t_0; elseif (x <= 2.05e-78) tmp = Float64(z * Float64(x + 5.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y + z); tmp = 0.0; if (x <= -240000000.0) tmp = t_0; elseif (x <= 2.05e-78) tmp = z * (x + 5.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -240000000.0], t$95$0, If[LessEqual[x, 2.05e-78], N[(z * N[(x + 5.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(y + z\right)\\
\mathbf{if}\;x \leq -240000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{-78}:\\
\;\;\;\;z \cdot \left(x + 5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.4e8 or 2.0499999999999999e-78 < x Initial program 100.0%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6494.3%
Simplified94.3%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6498.0%
Simplified98.0%
if -2.4e8 < x < 2.0499999999999999e-78Initial program 99.8%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6499.8%
Simplified99.8%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-lowering-+.f6480.3%
Simplified80.3%
Final simplification90.0%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* x (+ y z)))) (if (<= x -5.5e-8) t_0 (if (<= x 1.4e-78) (* z 5.0) t_0))))
double code(double x, double y, double z) {
double t_0 = x * (y + z);
double tmp;
if (x <= -5.5e-8) {
tmp = t_0;
} else if (x <= 1.4e-78) {
tmp = z * 5.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 = x * (y + z)
if (x <= (-5.5d-8)) then
tmp = t_0
else if (x <= 1.4d-78) then
tmp = z * 5.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (y + z);
double tmp;
if (x <= -5.5e-8) {
tmp = t_0;
} else if (x <= 1.4e-78) {
tmp = z * 5.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y + z) tmp = 0 if x <= -5.5e-8: tmp = t_0 elif x <= 1.4e-78: tmp = z * 5.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y + z)) tmp = 0.0 if (x <= -5.5e-8) tmp = t_0; elseif (x <= 1.4e-78) tmp = Float64(z * 5.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y + z); tmp = 0.0; if (x <= -5.5e-8) tmp = t_0; elseif (x <= 1.4e-78) tmp = z * 5.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e-8], t$95$0, If[LessEqual[x, 1.4e-78], N[(z * 5.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(y + z\right)\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-78}:\\
\;\;\;\;z \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -5.5000000000000003e-8 or 1.40000000000000012e-78 < x Initial program 100.0%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6494.3%
Simplified94.3%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f6497.7%
Simplified97.7%
if -5.5000000000000003e-8 < x < 1.40000000000000012e-78Initial program 99.8%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
*-lowering-*.f6479.4%
Simplified79.4%
Final simplification89.5%
(FPCore (x y z) :precision binary64 (if (<= x 5e+37) (+ (* x y) (* z (+ x 5.0))) (* x (+ y z))))
double code(double x, double y, double z) {
double tmp;
if (x <= 5e+37) {
tmp = (x * y) + (z * (x + 5.0));
} 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 (x <= 5d+37) then
tmp = (x * y) + (z * (x + 5.0d0))
else
tmp = x * (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 5e+37) {
tmp = (x * y) + (z * (x + 5.0));
} else {
tmp = x * (y + z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 5e+37: tmp = (x * y) + (z * (x + 5.0)) else: tmp = x * (y + z) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 5e+37) tmp = Float64(Float64(x * y) + Float64(z * Float64(x + 5.0))); else tmp = Float64(x * Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 5e+37) tmp = (x * y) + (z * (x + 5.0)); else tmp = x * (y + z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 5e+37], N[(N[(x * y), $MachinePrecision] + N[(z * N[(x + 5.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5 \cdot 10^{+37}:\\
\;\;\;\;x \cdot y + z \cdot \left(x + 5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y + z\right)\\
\end{array}
\end{array}
if x < 4.99999999999999989e37Initial program 99.9%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6498.4%
Simplified98.4%
if 4.99999999999999989e37 < x Initial program 100.0%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6490.7%
Simplified90.7%
Taylor expanded in x around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64100.0%
Simplified100.0%
Final simplification98.7%
(FPCore (x y z) :precision binary64 (if (<= x -5.2e-7) (* x y) (if (<= x 7.5e-69) (* z 5.0) (* x y))))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.2e-7) {
tmp = x * y;
} else if (x <= 7.5e-69) {
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 (x <= (-5.2d-7)) then
tmp = x * y
else if (x <= 7.5d-69) 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 (x <= -5.2e-7) {
tmp = x * y;
} else if (x <= 7.5e-69) {
tmp = z * 5.0;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.2e-7: tmp = x * y elif x <= 7.5e-69: tmp = z * 5.0 else: tmp = x * y return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.2e-7) tmp = Float64(x * y); elseif (x <= 7.5e-69) 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 (x <= -5.2e-7) tmp = x * y; elseif (x <= 7.5e-69) tmp = z * 5.0; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.2e-7], N[(x * y), $MachinePrecision], If[LessEqual[x, 7.5e-69], N[(z * 5.0), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{-7}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-69}:\\
\;\;\;\;z \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
\end{array}
if x < -5.19999999999999998e-7 or 7.5e-69 < x Initial program 100.0%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6494.2%
Simplified94.2%
Taylor expanded in y around inf
*-lowering-*.f6459.6%
Simplified59.6%
if -5.19999999999999998e-7 < x < 7.5e-69Initial program 99.8%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6499.8%
Simplified99.8%
Taylor expanded in x around 0
*-lowering-*.f6478.9%
Simplified78.9%
Final simplification68.4%
(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%
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6496.8%
Simplified96.8%
Taylor expanded in x around 0
*-lowering-*.f6437.9%
Simplified37.9%
Final simplification37.9%
(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 2024191
(FPCore (x y z)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, C"
:precision binary64
:alt
(! :herbie-platform default (+ (* (+ x 5) z) (* x y)))
(+ (* x (+ y z)) (* z 5.0)))