
(FPCore (x y z t) :precision binary64 (+ (- (* (/ 1.0 8.0) x) (/ (* y z) 2.0)) t))
double code(double x, double y, double z, double t) {
return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t;
}
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 = (((1.0d0 / 8.0d0) * x) - ((y * z) / 2.0d0)) + t
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t;
}
def code(x, y, z, t): return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / 8.0) * x) - Float64(Float64(y * z) / 2.0)) + t) end
function tmp = code(x, y, z, t) tmp = (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / 8.0), $MachinePrecision] * x), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (* (/ 1.0 8.0) x) (/ (* y z) 2.0)) t))
double code(double x, double y, double z, double t) {
return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t;
}
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 = (((1.0d0 / 8.0d0) * x) - ((y * z) / 2.0d0)) + t
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t;
}
def code(x, y, z, t): return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / 8.0) * x) - Float64(Float64(y * z) / 2.0)) + t) end
function tmp = code(x, y, z, t) tmp = (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / 8.0), $MachinePrecision] * x), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t
\end{array}
(FPCore (x y z t) :precision binary64 (+ (fma (* z -0.5) y (* 0.125 x)) t))
double code(double x, double y, double z, double t) {
return fma((z * -0.5), y, (0.125 * x)) + t;
}
function code(x, y, z, t) return Float64(fma(Float64(z * -0.5), y, Float64(0.125 * x)) + t) end
code[x_, y_, z_, t_] := N[(N[(N[(z * -0.5), $MachinePrecision] * y + N[(0.125 * x), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z \cdot -0.5, y, 0.125 \cdot x\right) + t
\end{array}
Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
associate-/l*99.9%
distribute-frac-neg99.9%
metadata-eval99.9%
distribute-neg-frac99.9%
frac-2neg99.9%
clear-num99.8%
associate-/r/99.9%
clear-num100.0%
fma-def100.0%
div-inv100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* -0.5 (* z y))))
(if (<= (* z y) -2.5e-10)
t_1
(if (<= (* z y) -9.5e-308)
t
(if (<= (* z y) 1.3e-245)
(* 0.125 x)
(if (<= (* z y) 1.4e-58)
t
(if (<= (* z y) 5000000000.0) (* 0.125 x) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = -0.5 * (z * y);
double tmp;
if ((z * y) <= -2.5e-10) {
tmp = t_1;
} else if ((z * y) <= -9.5e-308) {
tmp = t;
} else if ((z * y) <= 1.3e-245) {
tmp = 0.125 * x;
} else if ((z * y) <= 1.4e-58) {
tmp = t;
} else if ((z * y) <= 5000000000.0) {
tmp = 0.125 * x;
} 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 = (-0.5d0) * (z * y)
if ((z * y) <= (-2.5d-10)) then
tmp = t_1
else if ((z * y) <= (-9.5d-308)) then
tmp = t
else if ((z * y) <= 1.3d-245) then
tmp = 0.125d0 * x
else if ((z * y) <= 1.4d-58) then
tmp = t
else if ((z * y) <= 5000000000.0d0) then
tmp = 0.125d0 * x
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 = -0.5 * (z * y);
double tmp;
if ((z * y) <= -2.5e-10) {
tmp = t_1;
} else if ((z * y) <= -9.5e-308) {
tmp = t;
} else if ((z * y) <= 1.3e-245) {
tmp = 0.125 * x;
} else if ((z * y) <= 1.4e-58) {
tmp = t;
} else if ((z * y) <= 5000000000.0) {
tmp = 0.125 * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -0.5 * (z * y) tmp = 0 if (z * y) <= -2.5e-10: tmp = t_1 elif (z * y) <= -9.5e-308: tmp = t elif (z * y) <= 1.3e-245: tmp = 0.125 * x elif (z * y) <= 1.4e-58: tmp = t elif (z * y) <= 5000000000.0: tmp = 0.125 * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-0.5 * Float64(z * y)) tmp = 0.0 if (Float64(z * y) <= -2.5e-10) tmp = t_1; elseif (Float64(z * y) <= -9.5e-308) tmp = t; elseif (Float64(z * y) <= 1.3e-245) tmp = Float64(0.125 * x); elseif (Float64(z * y) <= 1.4e-58) tmp = t; elseif (Float64(z * y) <= 5000000000.0) tmp = Float64(0.125 * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -0.5 * (z * y); tmp = 0.0; if ((z * y) <= -2.5e-10) tmp = t_1; elseif ((z * y) <= -9.5e-308) tmp = t; elseif ((z * y) <= 1.3e-245) tmp = 0.125 * x; elseif ((z * y) <= 1.4e-58) tmp = t; elseif ((z * y) <= 5000000000.0) tmp = 0.125 * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-0.5 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * y), $MachinePrecision], -2.5e-10], t$95$1, If[LessEqual[N[(z * y), $MachinePrecision], -9.5e-308], t, If[LessEqual[N[(z * y), $MachinePrecision], 1.3e-245], N[(0.125 * x), $MachinePrecision], If[LessEqual[N[(z * y), $MachinePrecision], 1.4e-58], t, If[LessEqual[N[(z * y), $MachinePrecision], 5000000000.0], N[(0.125 * x), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -0.5 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \cdot y \leq -2.5 \cdot 10^{-10}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \cdot y \leq -9.5 \cdot 10^{-308}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \cdot y \leq 1.3 \cdot 10^{-245}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{elif}\;z \cdot y \leq 1.4 \cdot 10^{-58}:\\
\;\;\;\;t\\
\mathbf{elif}\;z \cdot y \leq 5000000000:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (*.f64 y z) < -2.50000000000000016e-10 or 5e9 < (*.f64 y z) Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
associate-/l*99.8%
distribute-frac-neg99.8%
metadata-eval99.8%
distribute-neg-frac99.8%
frac-2neg99.8%
clear-num99.7%
associate-/r/99.9%
clear-num100.0%
fma-def100.0%
div-inv100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 69.5%
if -2.50000000000000016e-10 < (*.f64 y z) < -9.49999999999999963e-308 or 1.30000000000000003e-245 < (*.f64 y z) < 1.4e-58Initial program 100.0%
Taylor expanded in t around inf 62.3%
if -9.49999999999999963e-308 < (*.f64 y z) < 1.30000000000000003e-245 or 1.4e-58 < (*.f64 y z) < 5e9Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
associate-/l*100.0%
distribute-frac-neg100.0%
metadata-eval100.0%
distribute-neg-frac100.0%
frac-2neg100.0%
clear-num100.0%
associate-/r/100.0%
clear-num100.0%
fma-def100.0%
div-inv100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 61.4%
Final simplification65.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* 0.5 (* z y))))
(if (<= (* z y) -5e-10)
(- t t_1)
(if (<= (* z y) 5e-16) (+ (* 0.125 x) t) (- (* 0.125 x) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = 0.5 * (z * y);
double tmp;
if ((z * y) <= -5e-10) {
tmp = t - t_1;
} else if ((z * y) <= 5e-16) {
tmp = (0.125 * x) + t;
} else {
tmp = (0.125 * x) - 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 = 0.5d0 * (z * y)
if ((z * y) <= (-5d-10)) then
tmp = t - t_1
else if ((z * y) <= 5d-16) then
tmp = (0.125d0 * x) + t
else
tmp = (0.125d0 * x) - t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 0.5 * (z * y);
double tmp;
if ((z * y) <= -5e-10) {
tmp = t - t_1;
} else if ((z * y) <= 5e-16) {
tmp = (0.125 * x) + t;
} else {
tmp = (0.125 * x) - t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 0.5 * (z * y) tmp = 0 if (z * y) <= -5e-10: tmp = t - t_1 elif (z * y) <= 5e-16: tmp = (0.125 * x) + t else: tmp = (0.125 * x) - t_1 return tmp
function code(x, y, z, t) t_1 = Float64(0.5 * Float64(z * y)) tmp = 0.0 if (Float64(z * y) <= -5e-10) tmp = Float64(t - t_1); elseif (Float64(z * y) <= 5e-16) tmp = Float64(Float64(0.125 * x) + t); else tmp = Float64(Float64(0.125 * x) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 0.5 * (z * y); tmp = 0.0; if ((z * y) <= -5e-10) tmp = t - t_1; elseif ((z * y) <= 5e-16) tmp = (0.125 * x) + t; else tmp = (0.125 * x) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(0.5 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * y), $MachinePrecision], -5e-10], N[(t - t$95$1), $MachinePrecision], If[LessEqual[N[(z * y), $MachinePrecision], 5e-16], N[(N[(0.125 * x), $MachinePrecision] + t), $MachinePrecision], N[(N[(0.125 * x), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.5 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \cdot y \leq -5 \cdot 10^{-10}:\\
\;\;\;\;t - t_1\\
\mathbf{elif}\;z \cdot y \leq 5 \cdot 10^{-16}:\\
\;\;\;\;0.125 \cdot x + t\\
\mathbf{else}:\\
\;\;\;\;0.125 \cdot x - t_1\\
\end{array}
\end{array}
if (*.f64 y z) < -5.00000000000000031e-10Initial program 100.0%
Taylor expanded in x around 0 89.9%
if -5.00000000000000031e-10 < (*.f64 y z) < 5.0000000000000004e-16Initial program 100.0%
Taylor expanded in x around inf 96.3%
if 5.0000000000000004e-16 < (*.f64 y z) Initial program 100.0%
Taylor expanded in t around 0 85.4%
Final simplification91.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (* z y) -5e-10) (not (<= (* z y) 20000000.0))) (- t (* 0.5 (* z y))) (+ (* 0.125 x) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * y) <= -5e-10) || !((z * y) <= 20000000.0)) {
tmp = t - (0.5 * (z * y));
} else {
tmp = (0.125 * 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 (((z * y) <= (-5d-10)) .or. (.not. ((z * y) <= 20000000.0d0))) then
tmp = t - (0.5d0 * (z * y))
else
tmp = (0.125d0 * x) + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * y) <= -5e-10) || !((z * y) <= 20000000.0)) {
tmp = t - (0.5 * (z * y));
} else {
tmp = (0.125 * x) + t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * y) <= -5e-10) or not ((z * y) <= 20000000.0): tmp = t - (0.5 * (z * y)) else: tmp = (0.125 * x) + t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z * y) <= -5e-10) || !(Float64(z * y) <= 20000000.0)) tmp = Float64(t - Float64(0.5 * Float64(z * y))); else tmp = Float64(Float64(0.125 * x) + t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * y) <= -5e-10) || ~(((z * y) <= 20000000.0))) tmp = t - (0.5 * (z * y)); else tmp = (0.125 * x) + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * y), $MachinePrecision], -5e-10], N[Not[LessEqual[N[(z * y), $MachinePrecision], 20000000.0]], $MachinePrecision]], N[(t - N[(0.5 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.125 * x), $MachinePrecision] + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot y \leq -5 \cdot 10^{-10} \lor \neg \left(z \cdot y \leq 20000000\right):\\
\;\;\;\;t - 0.5 \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;0.125 \cdot x + t\\
\end{array}
\end{array}
if (*.f64 y z) < -5.00000000000000031e-10 or 2e7 < (*.f64 y z) Initial program 100.0%
Taylor expanded in x around 0 85.6%
if -5.00000000000000031e-10 < (*.f64 y z) < 2e7Initial program 100.0%
Taylor expanded in x around inf 96.4%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (if (or (<= (* z y) -2e+26) (not (<= (* z y) 5e+172))) (* -0.5 (* z y)) (+ (* 0.125 x) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * y) <= -2e+26) || !((z * y) <= 5e+172)) {
tmp = -0.5 * (z * y);
} else {
tmp = (0.125 * 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 (((z * y) <= (-2d+26)) .or. (.not. ((z * y) <= 5d+172))) then
tmp = (-0.5d0) * (z * y)
else
tmp = (0.125d0 * x) + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * y) <= -2e+26) || !((z * y) <= 5e+172)) {
tmp = -0.5 * (z * y);
} else {
tmp = (0.125 * x) + t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * y) <= -2e+26) or not ((z * y) <= 5e+172): tmp = -0.5 * (z * y) else: tmp = (0.125 * x) + t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z * y) <= -2e+26) || !(Float64(z * y) <= 5e+172)) tmp = Float64(-0.5 * Float64(z * y)); else tmp = Float64(Float64(0.125 * x) + t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * y) <= -2e+26) || ~(((z * y) <= 5e+172))) tmp = -0.5 * (z * y); else tmp = (0.125 * x) + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * y), $MachinePrecision], -2e+26], N[Not[LessEqual[N[(z * y), $MachinePrecision], 5e+172]], $MachinePrecision]], N[(-0.5 * N[(z * y), $MachinePrecision]), $MachinePrecision], N[(N[(0.125 * x), $MachinePrecision] + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot y \leq -2 \cdot 10^{+26} \lor \neg \left(z \cdot y \leq 5 \cdot 10^{+172}\right):\\
\;\;\;\;-0.5 \cdot \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;0.125 \cdot x + t\\
\end{array}
\end{array}
if (*.f64 y z) < -2.0000000000000001e26 or 5.0000000000000001e172 < (*.f64 y z) Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
associate-/l*99.8%
distribute-frac-neg99.8%
metadata-eval99.8%
distribute-neg-frac99.8%
frac-2neg99.8%
clear-num99.7%
associate-/r/99.9%
clear-num100.0%
fma-def100.0%
div-inv100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf 80.7%
if -2.0000000000000001e26 < (*.f64 y z) < 5.0000000000000001e172Initial program 100.0%
Taylor expanded in x around inf 85.9%
Final simplification84.1%
(FPCore (x y z t) :precision binary64 (- (+ (* 0.125 x) t) (* y (* z 0.5))))
double code(double x, double y, double z, double t) {
return ((0.125 * x) + t) - (y * (z * 0.5));
}
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 = ((0.125d0 * x) + t) - (y * (z * 0.5d0))
end function
public static double code(double x, double y, double z, double t) {
return ((0.125 * x) + t) - (y * (z * 0.5));
}
def code(x, y, z, t): return ((0.125 * x) + t) - (y * (z * 0.5))
function code(x, y, z, t) return Float64(Float64(Float64(0.125 * x) + t) - Float64(y * Float64(z * 0.5))) end
function tmp = code(x, y, z, t) tmp = ((0.125 * x) + t) - (y * (z * 0.5)); end
code[x_, y_, z_, t_] := N[(N[(N[(0.125 * x), $MachinePrecision] + t), $MachinePrecision] - N[(y * N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0.125 \cdot x + t\right) - y \cdot \left(z \cdot 0.5\right)
\end{array}
Initial program 100.0%
+-commutative100.0%
associate-+r-100.0%
metadata-eval100.0%
div-inv100.0%
associate-*l*100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (<= t -7.6e+36) t (if (<= t 9e+33) (* 0.125 x) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7.6e+36) {
tmp = t;
} else if (t <= 9e+33) {
tmp = 0.125 * x;
} else {
tmp = 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 (t <= (-7.6d+36)) then
tmp = t
else if (t <= 9d+33) then
tmp = 0.125d0 * x
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7.6e+36) {
tmp = t;
} else if (t <= 9e+33) {
tmp = 0.125 * x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -7.6e+36: tmp = t elif t <= 9e+33: tmp = 0.125 * x else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -7.6e+36) tmp = t; elseif (t <= 9e+33) tmp = Float64(0.125 * x); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -7.6e+36) tmp = t; elseif (t <= 9e+33) tmp = 0.125 * x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -7.6e+36], t, If[LessEqual[t, 9e+33], N[(0.125 * x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.6 \cdot 10^{+36}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+33}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if t < -7.6000000000000005e36 or 9.0000000000000001e33 < t Initial program 100.0%
Taylor expanded in t around inf 67.2%
if -7.6000000000000005e36 < t < 9.0000000000000001e33Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
associate-/l*99.8%
distribute-frac-neg99.8%
metadata-eval99.8%
distribute-neg-frac99.8%
frac-2neg99.8%
clear-num99.7%
associate-/r/99.9%
clear-num100.0%
fma-def100.0%
div-inv100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 40.4%
Final simplification52.5%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return t;
}
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 = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 100.0%
Taylor expanded in t around inf 35.5%
Final simplification35.5%
(FPCore (x y z t) :precision binary64 (- (+ (/ x 8.0) t) (* (/ z 2.0) y)))
double code(double x, double y, double z, double t) {
return ((x / 8.0) + t) - ((z / 2.0) * y);
}
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 / 8.0d0) + t) - ((z / 2.0d0) * y)
end function
public static double code(double x, double y, double z, double t) {
return ((x / 8.0) + t) - ((z / 2.0) * y);
}
def code(x, y, z, t): return ((x / 8.0) + t) - ((z / 2.0) * y)
function code(x, y, z, t) return Float64(Float64(Float64(x / 8.0) + t) - Float64(Float64(z / 2.0) * y)) end
function tmp = code(x, y, z, t) tmp = ((x / 8.0) + t) - ((z / 2.0) * y); end
code[x_, y_, z_, t_] := N[(N[(N[(x / 8.0), $MachinePrecision] + t), $MachinePrecision] - N[(N[(z / 2.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\frac{x}{8} + t\right) - \frac{z}{2} \cdot y
\end{array}
herbie shell --seed 2023297
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(- (+ (/ x 8.0) t) (* (/ z 2.0) y))
(+ (- (* (/ 1.0 8.0) x) (/ (* y z) 2.0)) t))