
(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 (- (* 0.125 x) (fma y (* z 0.5) (- t))))
double code(double x, double y, double z, double t) {
return (0.125 * x) - fma(y, (z * 0.5), -t);
}
function code(x, y, z, t) return Float64(Float64(0.125 * x) - fma(y, Float64(z * 0.5), Float64(-t))) end
code[x_, y_, z_, t_] := N[(N[(0.125 * x), $MachinePrecision] - N[(y * N[(z * 0.5), $MachinePrecision] + (-t)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.125 \cdot x - \mathsf{fma}\left(y, z \cdot 0.5, -t\right)
\end{array}
Initial program 100.0%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
associate-+l-100.0%
fma-neg100.0%
div-inv100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- t (* y (* z 0.5)))))
(if (<= (* y z) -2e+91)
t_1
(if (<= (* y z) -2e+42)
(- (* 0.125 x) (* 0.5 (* y z)))
(if (or (<= (* y z) -1e-13) (not (<= (* y z) 1e+24)))
t_1
(+ (* 0.125 x) t))))))
double code(double x, double y, double z, double t) {
double t_1 = t - (y * (z * 0.5));
double tmp;
if ((y * z) <= -2e+91) {
tmp = t_1;
} else if ((y * z) <= -2e+42) {
tmp = (0.125 * x) - (0.5 * (y * z));
} else if (((y * z) <= -1e-13) || !((y * z) <= 1e+24)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = t - (y * (z * 0.5d0))
if ((y * z) <= (-2d+91)) then
tmp = t_1
else if ((y * z) <= (-2d+42)) then
tmp = (0.125d0 * x) - (0.5d0 * (y * z))
else if (((y * z) <= (-1d-13)) .or. (.not. ((y * z) <= 1d+24))) then
tmp = t_1
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 t_1 = t - (y * (z * 0.5));
double tmp;
if ((y * z) <= -2e+91) {
tmp = t_1;
} else if ((y * z) <= -2e+42) {
tmp = (0.125 * x) - (0.5 * (y * z));
} else if (((y * z) <= -1e-13) || !((y * z) <= 1e+24)) {
tmp = t_1;
} else {
tmp = (0.125 * x) + t;
}
return tmp;
}
def code(x, y, z, t): t_1 = t - (y * (z * 0.5)) tmp = 0 if (y * z) <= -2e+91: tmp = t_1 elif (y * z) <= -2e+42: tmp = (0.125 * x) - (0.5 * (y * z)) elif ((y * z) <= -1e-13) or not ((y * z) <= 1e+24): tmp = t_1 else: tmp = (0.125 * x) + t return tmp
function code(x, y, z, t) t_1 = Float64(t - Float64(y * Float64(z * 0.5))) tmp = 0.0 if (Float64(y * z) <= -2e+91) tmp = t_1; elseif (Float64(y * z) <= -2e+42) tmp = Float64(Float64(0.125 * x) - Float64(0.5 * Float64(y * z))); elseif ((Float64(y * z) <= -1e-13) || !(Float64(y * z) <= 1e+24)) tmp = t_1; else tmp = Float64(Float64(0.125 * x) + t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t - (y * (z * 0.5)); tmp = 0.0; if ((y * z) <= -2e+91) tmp = t_1; elseif ((y * z) <= -2e+42) tmp = (0.125 * x) - (0.5 * (y * z)); elseif (((y * z) <= -1e-13) || ~(((y * z) <= 1e+24))) tmp = t_1; else tmp = (0.125 * x) + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t - N[(y * N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * z), $MachinePrecision], -2e+91], t$95$1, If[LessEqual[N[(y * z), $MachinePrecision], -2e+42], N[(N[(0.125 * x), $MachinePrecision] - N[(0.5 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(y * z), $MachinePrecision], -1e-13], N[Not[LessEqual[N[(y * z), $MachinePrecision], 1e+24]], $MachinePrecision]], t$95$1, N[(N[(0.125 * x), $MachinePrecision] + t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - y \cdot \left(z \cdot 0.5\right)\\
\mathbf{if}\;y \cdot z \leq -2 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot z \leq -2 \cdot 10^{+42}:\\
\;\;\;\;0.125 \cdot x - 0.5 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;y \cdot z \leq -1 \cdot 10^{-13} \lor \neg \left(y \cdot z \leq 10^{+24}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;0.125 \cdot x + t\\
\end{array}
\end{array}
if (*.f64 y z) < -2.00000000000000016e91 or -2.00000000000000009e42 < (*.f64 y z) < -1e-13 or 9.9999999999999998e23 < (*.f64 y z) Initial program 100.0%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around 0 94.0%
*-commutative94.0%
associate-*r*94.0%
*-commutative94.0%
Simplified94.0%
if -2.00000000000000016e91 < (*.f64 y z) < -2.00000000000000009e42Initial program 99.8%
add099.8%
add099.8%
metadata-eval99.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around 0 97.9%
if -1e-13 < (*.f64 y z) < 9.9999999999999998e23Initial program 100.0%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 94.6%
Final simplification94.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (* y -0.5))))
(if (<= y -3.6e+37)
t_1
(if (<= y 3.15e-254)
t
(if (<= y 1.5e-170)
(* 0.125 x)
(if (<= y 3e-92) t (if (<= y 4.5e-13) (* 0.125 x) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (y * -0.5);
double tmp;
if (y <= -3.6e+37) {
tmp = t_1;
} else if (y <= 3.15e-254) {
tmp = t;
} else if (y <= 1.5e-170) {
tmp = 0.125 * x;
} else if (y <= 3e-92) {
tmp = t;
} else if (y <= 4.5e-13) {
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 = z * (y * (-0.5d0))
if (y <= (-3.6d+37)) then
tmp = t_1
else if (y <= 3.15d-254) then
tmp = t
else if (y <= 1.5d-170) then
tmp = 0.125d0 * x
else if (y <= 3d-92) then
tmp = t
else if (y <= 4.5d-13) 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 = z * (y * -0.5);
double tmp;
if (y <= -3.6e+37) {
tmp = t_1;
} else if (y <= 3.15e-254) {
tmp = t;
} else if (y <= 1.5e-170) {
tmp = 0.125 * x;
} else if (y <= 3e-92) {
tmp = t;
} else if (y <= 4.5e-13) {
tmp = 0.125 * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (y * -0.5) tmp = 0 if y <= -3.6e+37: tmp = t_1 elif y <= 3.15e-254: tmp = t elif y <= 1.5e-170: tmp = 0.125 * x elif y <= 3e-92: tmp = t elif y <= 4.5e-13: tmp = 0.125 * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(y * -0.5)) tmp = 0.0 if (y <= -3.6e+37) tmp = t_1; elseif (y <= 3.15e-254) tmp = t; elseif (y <= 1.5e-170) tmp = Float64(0.125 * x); elseif (y <= 3e-92) tmp = t; elseif (y <= 4.5e-13) tmp = Float64(0.125 * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (y * -0.5); tmp = 0.0; if (y <= -3.6e+37) tmp = t_1; elseif (y <= 3.15e-254) tmp = t; elseif (y <= 1.5e-170) tmp = 0.125 * x; elseif (y <= 3e-92) tmp = t; elseif (y <= 4.5e-13) tmp = 0.125 * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(y * -0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.6e+37], t$95$1, If[LessEqual[y, 3.15e-254], t, If[LessEqual[y, 1.5e-170], N[(0.125 * x), $MachinePrecision], If[LessEqual[y, 3e-92], t, If[LessEqual[y, 4.5e-13], N[(0.125 * x), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y \cdot -0.5\right)\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.15 \cdot 10^{-254}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{-170}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-92}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-13}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.59999999999999998e37 or 4.5e-13 < y Initial program 100.0%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around inf 62.7%
associate-*r*62.7%
Simplified62.7%
if -3.59999999999999998e37 < y < 3.1500000000000001e-254 or 1.50000000000000007e-170 < y < 3.00000000000000013e-92Initial program 100.0%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 43.9%
if 3.1500000000000001e-254 < y < 1.50000000000000007e-170 or 3.00000000000000013e-92 < y < 4.5e-13Initial program 100.0%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around inf 37.5%
Final simplification52.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.4e+46) (not (<= y 7.4e-13))) (- t (* y (* z 0.5))) (+ (* 0.125 x) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.4e+46) || !(y <= 7.4e-13)) {
tmp = t - (y * (z * 0.5));
} 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 ((y <= (-3.4d+46)) .or. (.not. (y <= 7.4d-13))) then
tmp = t - (y * (z * 0.5d0))
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 ((y <= -3.4e+46) || !(y <= 7.4e-13)) {
tmp = t - (y * (z * 0.5));
} else {
tmp = (0.125 * x) + t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.4e+46) or not (y <= 7.4e-13): tmp = t - (y * (z * 0.5)) else: tmp = (0.125 * x) + t return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.4e+46) || !(y <= 7.4e-13)) tmp = Float64(t - Float64(y * Float64(z * 0.5))); else tmp = Float64(Float64(0.125 * x) + t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.4e+46) || ~((y <= 7.4e-13))) tmp = t - (y * (z * 0.5)); else tmp = (0.125 * x) + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.4e+46], N[Not[LessEqual[y, 7.4e-13]], $MachinePrecision]], N[(t - N[(y * N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.125 * x), $MachinePrecision] + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+46} \lor \neg \left(y \leq 7.4 \cdot 10^{-13}\right):\\
\;\;\;\;t - y \cdot \left(z \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.125 \cdot x + t\\
\end{array}
\end{array}
if y < -3.3999999999999998e46 or 7.39999999999999977e-13 < y Initial program 100.0%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around 0 84.4%
*-commutative84.4%
associate-*r*84.4%
*-commutative84.4%
Simplified84.4%
if -3.3999999999999998e46 < y < 7.39999999999999977e-13Initial program 100.0%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 82.3%
Final simplification83.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.4e+74) (not (<= y 2.6e-11))) (* z (* y -0.5)) (+ (* 0.125 x) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.4e+74) || !(y <= 2.6e-11)) {
tmp = z * (y * -0.5);
} 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 ((y <= (-1.4d+74)) .or. (.not. (y <= 2.6d-11))) then
tmp = z * (y * (-0.5d0))
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 ((y <= -1.4e+74) || !(y <= 2.6e-11)) {
tmp = z * (y * -0.5);
} else {
tmp = (0.125 * x) + t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.4e+74) or not (y <= 2.6e-11): tmp = z * (y * -0.5) else: tmp = (0.125 * x) + t return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.4e+74) || !(y <= 2.6e-11)) tmp = Float64(z * Float64(y * -0.5)); else tmp = Float64(Float64(0.125 * x) + t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.4e+74) || ~((y <= 2.6e-11))) tmp = z * (y * -0.5); else tmp = (0.125 * x) + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.4e+74], N[Not[LessEqual[y, 2.6e-11]], $MachinePrecision]], N[(z * N[(y * -0.5), $MachinePrecision]), $MachinePrecision], N[(N[(0.125 * x), $MachinePrecision] + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+74} \lor \neg \left(y \leq 2.6 \cdot 10^{-11}\right):\\
\;\;\;\;z \cdot \left(y \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.125 \cdot x + t\\
\end{array}
\end{array}
if y < -1.40000000000000001e74 or 2.6000000000000001e-11 < y Initial program 100.0%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around inf 63.6%
associate-*r*63.6%
Simplified63.6%
if -1.40000000000000001e74 < y < 2.6000000000000001e-11Initial program 100.0%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 81.5%
Final simplification72.7%
(FPCore (x y z t) :precision binary64 (if (<= t -1.35e+22) t (if (<= t 7.5e+24) (* 0.125 x) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.35e+22) {
tmp = t;
} else if (t <= 7.5e+24) {
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 <= (-1.35d+22)) then
tmp = t
else if (t <= 7.5d+24) 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 <= -1.35e+22) {
tmp = t;
} else if (t <= 7.5e+24) {
tmp = 0.125 * x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.35e+22: tmp = t elif t <= 7.5e+24: tmp = 0.125 * x else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.35e+22) tmp = t; elseif (t <= 7.5e+24) 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 <= -1.35e+22) tmp = t; elseif (t <= 7.5e+24) tmp = 0.125 * x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.35e+22], t, If[LessEqual[t, 7.5e+24], N[(0.125 * x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{+22}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq 7.5 \cdot 10^{+24}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if t < -1.3500000000000001e22 or 7.50000000000000014e24 < t Initial program 100.0%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 56.3%
if -1.3500000000000001e22 < t < 7.50000000000000014e24Initial program 100.0%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around inf 45.1%
Final simplification50.7%
(FPCore (x y z t) :precision binary64 (+ t (- (* 0.125 x) (* y (/ z 2.0)))))
double code(double x, double y, double z, double t) {
return t + ((0.125 * x) - (y * (z / 2.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 = t + ((0.125d0 * x) - (y * (z / 2.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return t + ((0.125 * x) - (y * (z / 2.0)));
}
def code(x, y, z, t): return t + ((0.125 * x) - (y * (z / 2.0)))
function code(x, y, z, t) return Float64(t + Float64(Float64(0.125 * x) - Float64(y * Float64(z / 2.0)))) end
function tmp = code(x, y, z, t) tmp = t + ((0.125 * x) - (y * (z / 2.0))); end
code[x_, y_, z_, t_] := N[(t + N[(N[(0.125 * x), $MachinePrecision] - N[(y * N[(z / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \left(0.125 \cdot x - y \cdot \frac{z}{2}\right)
\end{array}
Initial program 100.0%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Final simplification100.0%
(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%
add0100.0%
add0100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 33.5%
Final simplification33.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 2024046
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, B"
:precision binary64
:alt
(- (+ (/ x 8.0) t) (* (/ z 2.0) y))
(+ (- (* (/ 1.0 8.0) x) (/ (* y z) 2.0)) t))