
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ y (+ z (+ y z))) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((y + (z + (y + z))) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((y + (z + (y + z))) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((y + (z + (y + z))) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((y + (z + (y + z))) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(y + Float64(z + Float64(y + z))) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((y + (z + (y + z))) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(y + N[(z + N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(y + \left(z + \left(y + z\right)\right)\right) + t\right) + y \cdot 5
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (+ z z))))
(if (<= z -1.95e+33)
t_1
(if (<= z -5.8e-132)
(* y 5.0)
(if (<= z 9.6e-84) (* x t) (if (<= z 1.8e+35) (* y 5.0) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * (z + z);
double tmp;
if (z <= -1.95e+33) {
tmp = t_1;
} else if (z <= -5.8e-132) {
tmp = y * 5.0;
} else if (z <= 9.6e-84) {
tmp = x * t;
} else if (z <= 1.8e+35) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (z + z)
if (z <= (-1.95d+33)) then
tmp = t_1
else if (z <= (-5.8d-132)) then
tmp = y * 5.0d0
else if (z <= 9.6d-84) then
tmp = x * t
else if (z <= 1.8d+35) then
tmp = y * 5.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (z + z);
double tmp;
if (z <= -1.95e+33) {
tmp = t_1;
} else if (z <= -5.8e-132) {
tmp = y * 5.0;
} else if (z <= 9.6e-84) {
tmp = x * t;
} else if (z <= 1.8e+35) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (z + z) tmp = 0 if z <= -1.95e+33: tmp = t_1 elif z <= -5.8e-132: tmp = y * 5.0 elif z <= 9.6e-84: tmp = x * t elif z <= 1.8e+35: tmp = y * 5.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(z + z)) tmp = 0.0 if (z <= -1.95e+33) tmp = t_1; elseif (z <= -5.8e-132) tmp = Float64(y * 5.0); elseif (z <= 9.6e-84) tmp = Float64(x * t); elseif (z <= 1.8e+35) tmp = Float64(y * 5.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (z + z); tmp = 0.0; if (z <= -1.95e+33) tmp = t_1; elseif (z <= -5.8e-132) tmp = y * 5.0; elseif (z <= 9.6e-84) tmp = x * t; elseif (z <= 1.8e+35) tmp = y * 5.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.95e+33], t$95$1, If[LessEqual[z, -5.8e-132], N[(y * 5.0), $MachinePrecision], If[LessEqual[z, 9.6e-84], N[(x * t), $MachinePrecision], If[LessEqual[z, 1.8e+35], N[(y * 5.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(z + z\right)\\
\mathbf{if}\;z \leq -1.95 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-132}:\\
\;\;\;\;y \cdot 5\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-84}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+35}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.9500000000000001e33 or 1.8e35 < z Initial program 100.0%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6466.2
Applied rewrites66.2%
Applied rewrites66.2%
if -1.9500000000000001e33 < z < -5.79999999999999967e-132 or 9.6000000000000007e-84 < z < 1.8e35Initial program 99.8%
Taylor expanded in x around 0
lower-*.f6450.2
Applied rewrites50.2%
if -5.79999999999999967e-132 < z < 9.6000000000000007e-84Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6452.2
Applied rewrites52.2%
Final simplification57.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (fma 2.0 (+ y z) t))))
(if (<= x -2.5)
t_1
(if (<= x 2.4e-23) (fma y 5.0 (fma x t (* x (+ z z)))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, (y + z), t);
double tmp;
if (x <= -2.5) {
tmp = t_1;
} else if (x <= 2.4e-23) {
tmp = fma(y, 5.0, fma(x, t, (x * (z + z))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, Float64(y + z), t)) tmp = 0.0 if (x <= -2.5) tmp = t_1; elseif (x <= 2.4e-23) tmp = fma(y, 5.0, fma(x, t, Float64(x * Float64(z + z)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5], t$95$1, If[LessEqual[x, 2.4e-23], N[(y * 5.0 + N[(x * t + N[(x * N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -2.5:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-23}:\\
\;\;\;\;\mathsf{fma}\left(y, 5, \mathsf{fma}\left(x, t, x \cdot \left(z + z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.5 or 2.39999999999999996e-23 < x Initial program 100.0%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6499.5
Applied rewrites99.5%
if -2.5 < x < 2.39999999999999996e-23Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied rewrites99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (fma 2.0 (+ y z) t))))
(if (<= x -2.5)
t_1
(if (<= x 2.4e-23) (fma y 5.0 (* x (+ t (+ z z)))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, (y + z), t);
double tmp;
if (x <= -2.5) {
tmp = t_1;
} else if (x <= 2.4e-23) {
tmp = fma(y, 5.0, (x * (t + (z + z))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, Float64(y + z), t)) tmp = 0.0 if (x <= -2.5) tmp = t_1; elseif (x <= 2.4e-23) tmp = fma(y, 5.0, Float64(x * Float64(t + Float64(z + z)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5], t$95$1, If[LessEqual[x, 2.4e-23], N[(y * 5.0 + N[(x * N[(t + N[(z + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -2.5:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{-23}:\\
\;\;\;\;\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(z + z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.5 or 2.39999999999999996e-23 < x Initial program 100.0%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6499.5
Applied rewrites99.5%
if -2.5 < x < 2.39999999999999996e-23Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f6499.8
Applied rewrites99.8%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (fma 2.0 (+ y z) t)))) (if (<= x -2.85e-83) t_1 (if (<= x 1.55e-49) (fma y 5.0 (* x t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, (y + z), t);
double tmp;
if (x <= -2.85e-83) {
tmp = t_1;
} else if (x <= 1.55e-49) {
tmp = fma(y, 5.0, (x * t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, Float64(y + z), t)) tmp = 0.0 if (x <= -2.85e-83) tmp = t_1; elseif (x <= 1.55e-49) tmp = fma(y, 5.0, Float64(x * t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.85e-83], t$95$1, If[LessEqual[x, 1.55e-49], N[(y * 5.0 + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, y + z, t\right)\\
\mathbf{if}\;x \leq -2.85 \cdot 10^{-83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-49}:\\
\;\;\;\;\mathsf{fma}\left(y, 5, x \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.85e-83 or 1.55e-49 < x Initial program 100.0%
Taylor expanded in x around inf
lower-*.f64N/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f6496.6
Applied rewrites96.6%
if -2.85e-83 < x < 1.55e-49Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64100.0
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-+.f64N/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
lower-+.f6499.9
Applied rewrites99.9%
Taylor expanded in z around 0
*-commutativeN/A
lower-*.f6484.7
Applied rewrites84.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (fma x 2.0 5.0)))) (if (<= y -1.1e+112) t_1 (if (<= y 2.4e+30) (* x (fma 2.0 z t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * fma(x, 2.0, 5.0);
double tmp;
if (y <= -1.1e+112) {
tmp = t_1;
} else if (y <= 2.4e+30) {
tmp = x * fma(2.0, z, t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * fma(x, 2.0, 5.0)) tmp = 0.0 if (y <= -1.1e+112) tmp = t_1; elseif (y <= 2.4e+30) tmp = Float64(x * fma(2.0, z, t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.1e+112], t$95$1, If[LessEqual[y, 2.4e+30], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{+30}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.1e112 or 2.3999999999999999e30 < y Initial program 99.9%
Taylor expanded in y around inf
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
lower-*.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f6481.4
Applied rewrites81.4%
if -1.1e112 < y < 2.3999999999999999e30Initial program 99.9%
Taylor expanded in y around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6481.8
Applied rewrites81.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (fma 2.0 z t)))) (if (<= x -6.5e-99) t_1 (if (<= x 2.25e-51) (* y 5.0) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, z, t);
double tmp;
if (x <= -6.5e-99) {
tmp = t_1;
} else if (x <= 2.25e-51) {
tmp = y * 5.0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, z, t)) tmp = 0.0 if (x <= -6.5e-99) tmp = t_1; elseif (x <= 2.25e-51) tmp = Float64(y * 5.0); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e-99], t$95$1, If[LessEqual[x, 2.25e-51], N[(y * 5.0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, z, t\right)\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{-99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{-51}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.50000000000000033e-99 or 2.24999999999999987e-51 < x Initial program 99.9%
Taylor expanded in y around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6475.7
Applied rewrites75.7%
if -6.50000000000000033e-99 < x < 2.24999999999999987e-51Initial program 99.9%
Taylor expanded in x around 0
lower-*.f6463.9
Applied rewrites63.9%
Final simplification71.6%
(FPCore (x y z t) :precision binary64 (if (<= x -2.85e-83) (* x t) (if (<= x 2.9e-50) (* y 5.0) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.85e-83) {
tmp = x * t;
} else if (x <= 2.9e-50) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-2.85d-83)) then
tmp = x * t
else if (x <= 2.9d-50) then
tmp = y * 5.0d0
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.85e-83) {
tmp = x * t;
} else if (x <= 2.9e-50) {
tmp = y * 5.0;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.85e-83: tmp = x * t elif x <= 2.9e-50: tmp = y * 5.0 else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.85e-83) tmp = Float64(x * t); elseif (x <= 2.9e-50) tmp = Float64(y * 5.0); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.85e-83) tmp = x * t; elseif (x <= 2.9e-50) tmp = y * 5.0; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.85e-83], N[(x * t), $MachinePrecision], If[LessEqual[x, 2.9e-50], N[(y * 5.0), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.85 \cdot 10^{-83}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-50}:\\
\;\;\;\;y \cdot 5\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -2.85e-83 or 2.90000000000000008e-50 < x Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
if -2.85e-83 < x < 2.90000000000000008e-50Initial program 99.9%
Taylor expanded in x around 0
lower-*.f6463.4
Applied rewrites63.4%
Final simplification48.0%
(FPCore (x y z t) :precision binary64 (* y 5.0))
double code(double x, double y, double z, double t) {
return y * 5.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * 5.0d0
end function
public static double code(double x, double y, double z, double t) {
return y * 5.0;
}
def code(x, y, z, t): return y * 5.0
function code(x, y, z, t) return Float64(y * 5.0) end
function tmp = code(x, y, z, t) tmp = y * 5.0; end
code[x_, y_, z_, t_] := N[(y * 5.0), $MachinePrecision]
\begin{array}{l}
\\
y \cdot 5
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
lower-*.f6426.4
Applied rewrites26.4%
Final simplification26.4%
herbie shell --seed 2024222
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
:precision binary64
(+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))