
(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 (* y -0.5) (fma 0.125 x t)))
double code(double x, double y, double z, double t) {
return fma(z, (y * -0.5), fma(0.125, x, t));
}
function code(x, y, z, t) return fma(z, Float64(y * -0.5), fma(0.125, x, t)) end
code[x_, y_, z_, t_] := N[(z * N[(y * -0.5), $MachinePrecision] + N[(0.125 * x + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, y \cdot -0.5, \mathsf{fma}\left(0.125, x, t\right)\right)
\end{array}
Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
associate-+l+99.7%
associate-/l*99.9%
distribute-frac-neg99.9%
associate-/r/100.0%
*-commutative100.0%
+-commutative100.0%
fma-def100.0%
neg-mul-1100.0%
associate-/l*99.9%
associate-/r/100.0%
*-commutative100.0%
metadata-eval100.0%
+-commutative100.0%
fma-def100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (* z -0.5))))
(if (<= t -5.3e+129)
t
(if (<= t -3.25e+78)
t_1
(if (<= t -1.45e+25)
t
(if (<= t -2.35e-142)
t_1
(if (<= t -4.8e-199)
(* 0.125 x)
(if (<= t 3.5e-269)
t_1
(if (<= t 2.6e-237)
(* 0.125 x)
(if (<= t 7.2e-187)
t_1
(if (<= t 1.3e-6)
(* 0.125 x)
(if (<= t 4.3e+76) t_1 t))))))))))))
double code(double x, double y, double z, double t) {
double t_1 = y * (z * -0.5);
double tmp;
if (t <= -5.3e+129) {
tmp = t;
} else if (t <= -3.25e+78) {
tmp = t_1;
} else if (t <= -1.45e+25) {
tmp = t;
} else if (t <= -2.35e-142) {
tmp = t_1;
} else if (t <= -4.8e-199) {
tmp = 0.125 * x;
} else if (t <= 3.5e-269) {
tmp = t_1;
} else if (t <= 2.6e-237) {
tmp = 0.125 * x;
} else if (t <= 7.2e-187) {
tmp = t_1;
} else if (t <= 1.3e-6) {
tmp = 0.125 * x;
} else if (t <= 4.3e+76) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * (z * (-0.5d0))
if (t <= (-5.3d+129)) then
tmp = t
else if (t <= (-3.25d+78)) then
tmp = t_1
else if (t <= (-1.45d+25)) then
tmp = t
else if (t <= (-2.35d-142)) then
tmp = t_1
else if (t <= (-4.8d-199)) then
tmp = 0.125d0 * x
else if (t <= 3.5d-269) then
tmp = t_1
else if (t <= 2.6d-237) then
tmp = 0.125d0 * x
else if (t <= 7.2d-187) then
tmp = t_1
else if (t <= 1.3d-6) then
tmp = 0.125d0 * x
else if (t <= 4.3d+76) then
tmp = t_1
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y * (z * -0.5);
double tmp;
if (t <= -5.3e+129) {
tmp = t;
} else if (t <= -3.25e+78) {
tmp = t_1;
} else if (t <= -1.45e+25) {
tmp = t;
} else if (t <= -2.35e-142) {
tmp = t_1;
} else if (t <= -4.8e-199) {
tmp = 0.125 * x;
} else if (t <= 3.5e-269) {
tmp = t_1;
} else if (t <= 2.6e-237) {
tmp = 0.125 * x;
} else if (t <= 7.2e-187) {
tmp = t_1;
} else if (t <= 1.3e-6) {
tmp = 0.125 * x;
} else if (t <= 4.3e+76) {
tmp = t_1;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (z * -0.5) tmp = 0 if t <= -5.3e+129: tmp = t elif t <= -3.25e+78: tmp = t_1 elif t <= -1.45e+25: tmp = t elif t <= -2.35e-142: tmp = t_1 elif t <= -4.8e-199: tmp = 0.125 * x elif t <= 3.5e-269: tmp = t_1 elif t <= 2.6e-237: tmp = 0.125 * x elif t <= 7.2e-187: tmp = t_1 elif t <= 1.3e-6: tmp = 0.125 * x elif t <= 4.3e+76: tmp = t_1 else: tmp = t return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(z * -0.5)) tmp = 0.0 if (t <= -5.3e+129) tmp = t; elseif (t <= -3.25e+78) tmp = t_1; elseif (t <= -1.45e+25) tmp = t; elseif (t <= -2.35e-142) tmp = t_1; elseif (t <= -4.8e-199) tmp = Float64(0.125 * x); elseif (t <= 3.5e-269) tmp = t_1; elseif (t <= 2.6e-237) tmp = Float64(0.125 * x); elseif (t <= 7.2e-187) tmp = t_1; elseif (t <= 1.3e-6) tmp = Float64(0.125 * x); elseif (t <= 4.3e+76) tmp = t_1; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (z * -0.5); tmp = 0.0; if (t <= -5.3e+129) tmp = t; elseif (t <= -3.25e+78) tmp = t_1; elseif (t <= -1.45e+25) tmp = t; elseif (t <= -2.35e-142) tmp = t_1; elseif (t <= -4.8e-199) tmp = 0.125 * x; elseif (t <= 3.5e-269) tmp = t_1; elseif (t <= 2.6e-237) tmp = 0.125 * x; elseif (t <= 7.2e-187) tmp = t_1; elseif (t <= 1.3e-6) tmp = 0.125 * x; elseif (t <= 4.3e+76) tmp = t_1; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z * -0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.3e+129], t, If[LessEqual[t, -3.25e+78], t$95$1, If[LessEqual[t, -1.45e+25], t, If[LessEqual[t, -2.35e-142], t$95$1, If[LessEqual[t, -4.8e-199], N[(0.125 * x), $MachinePrecision], If[LessEqual[t, 3.5e-269], t$95$1, If[LessEqual[t, 2.6e-237], N[(0.125 * x), $MachinePrecision], If[LessEqual[t, 7.2e-187], t$95$1, If[LessEqual[t, 1.3e-6], N[(0.125 * x), $MachinePrecision], If[LessEqual[t, 4.3e+76], t$95$1, t]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z \cdot -0.5\right)\\
\mathbf{if}\;t \leq -5.3 \cdot 10^{+129}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq -3.25 \cdot 10^{+78}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{+25}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq -2.35 \cdot 10^{-142}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.8 \cdot 10^{-199}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-269}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-237}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-187}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-6}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{elif}\;t \leq 4.3 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if t < -5.2999999999999999e129 or -3.25000000000000018e78 < t < -1.44999999999999995e25 or 4.29999999999999978e76 < t Initial program 100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 70.6%
if -5.2999999999999999e129 < t < -3.25000000000000018e78 or -1.44999999999999995e25 < t < -2.34999999999999995e-142 or -4.79999999999999991e-199 < t < 3.50000000000000019e-269 or 2.6000000000000002e-237 < t < 7.19999999999999989e-187 or 1.30000000000000005e-6 < t < 4.29999999999999978e76Initial program 100.0%
metadata-eval100.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 78.0%
*-commutative78.0%
associate-*l*78.0%
Simplified78.0%
Taylor expanded in y around inf 65.7%
*-commutative65.7%
associate-*r*65.7%
*-commutative65.7%
Simplified65.7%
if -2.34999999999999995e-142 < t < -4.79999999999999991e-199 or 3.50000000000000019e-269 < t < 2.6000000000000002e-237 or 7.19999999999999989e-187 < t < 1.30000000000000005e-6Initial program 98.8%
metadata-eval98.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 90.8%
Taylor expanded in x around inf 69.8%
Final simplification68.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.5e+57) (not (<= t 3.05))) (+ t (* y (* z -0.5))) (- (* 0.125 x) (* 0.5 (* z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.5e+57) || !(t <= 3.05)) {
tmp = t + (y * (z * -0.5));
} else {
tmp = (0.125 * x) - (0.5 * (z * y));
}
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 <= (-2.5d+57)) .or. (.not. (t <= 3.05d0))) then
tmp = t + (y * (z * (-0.5d0)))
else
tmp = (0.125d0 * x) - (0.5d0 * (z * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.5e+57) || !(t <= 3.05)) {
tmp = t + (y * (z * -0.5));
} else {
tmp = (0.125 * x) - (0.5 * (z * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.5e+57) or not (t <= 3.05): tmp = t + (y * (z * -0.5)) else: tmp = (0.125 * x) - (0.5 * (z * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.5e+57) || !(t <= 3.05)) tmp = Float64(t + Float64(y * Float64(z * -0.5))); else tmp = Float64(Float64(0.125 * x) - Float64(0.5 * Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.5e+57) || ~((t <= 3.05))) tmp = t + (y * (z * -0.5)); else tmp = (0.125 * x) - (0.5 * (z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.5e+57], N[Not[LessEqual[t, 3.05]], $MachinePrecision]], N[(t + N[(y * N[(z * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.125 * x), $MachinePrecision] - N[(0.5 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+57} \lor \neg \left(t \leq 3.05\right):\\
\;\;\;\;t + y \cdot \left(z \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;0.125 \cdot x - 0.5 \cdot \left(z \cdot y\right)\\
\end{array}
\end{array}
if t < -2.49999999999999986e57 or 3.0499999999999998 < t Initial program 100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around 0 92.9%
*-commutative92.9%
associate-*l*92.9%
Simplified92.9%
if -2.49999999999999986e57 < t < 3.0499999999999998Initial program 99.4%
metadata-eval99.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 90.5%
Final simplification91.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -3.5e-78) (not (<= z 3.05e-75))) (+ t (* y (* z -0.5))) (+ t (* 0.125 x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.5e-78) || !(z <= 3.05e-75)) {
tmp = t + (y * (z * -0.5));
} else {
tmp = t + (0.125 * x);
}
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 <= (-3.5d-78)) .or. (.not. (z <= 3.05d-75))) then
tmp = t + (y * (z * (-0.5d0)))
else
tmp = t + (0.125d0 * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -3.5e-78) || !(z <= 3.05e-75)) {
tmp = t + (y * (z * -0.5));
} else {
tmp = t + (0.125 * x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -3.5e-78) or not (z <= 3.05e-75): tmp = t + (y * (z * -0.5)) else: tmp = t + (0.125 * x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -3.5e-78) || !(z <= 3.05e-75)) tmp = Float64(t + Float64(y * Float64(z * -0.5))); else tmp = Float64(t + Float64(0.125 * x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -3.5e-78) || ~((z <= 3.05e-75))) tmp = t + (y * (z * -0.5)); else tmp = t + (0.125 * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -3.5e-78], N[Not[LessEqual[z, 3.05e-75]], $MachinePrecision]], N[(t + N[(y * N[(z * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(0.125 * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-78} \lor \neg \left(z \leq 3.05 \cdot 10^{-75}\right):\\
\;\;\;\;t + y \cdot \left(z \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t + 0.125 \cdot x\\
\end{array}
\end{array}
if z < -3.4999999999999999e-78 or 3.05000000000000021e-75 < z Initial program 99.5%
metadata-eval99.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 74.3%
*-commutative74.3%
associate-*l*74.8%
Simplified74.8%
if -3.4999999999999999e-78 < z < 3.05000000000000021e-75Initial program 100.0%
metadata-eval100.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 86.2%
Final simplification78.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.1e+187) (not (<= y 2.15e-113))) (* y (* z -0.5)) (+ t (* 0.125 x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.1e+187) || !(y <= 2.15e-113)) {
tmp = y * (z * -0.5);
} else {
tmp = t + (0.125 * x);
}
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.1d+187)) .or. (.not. (y <= 2.15d-113))) then
tmp = y * (z * (-0.5d0))
else
tmp = t + (0.125d0 * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.1e+187) || !(y <= 2.15e-113)) {
tmp = y * (z * -0.5);
} else {
tmp = t + (0.125 * x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.1e+187) or not (y <= 2.15e-113): tmp = y * (z * -0.5) else: tmp = t + (0.125 * x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.1e+187) || !(y <= 2.15e-113)) tmp = Float64(y * Float64(z * -0.5)); else tmp = Float64(t + Float64(0.125 * x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.1e+187) || ~((y <= 2.15e-113))) tmp = y * (z * -0.5); else tmp = t + (0.125 * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.1e+187], N[Not[LessEqual[y, 2.15e-113]], $MachinePrecision]], N[(y * N[(z * -0.5), $MachinePrecision]), $MachinePrecision], N[(t + N[(0.125 * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+187} \lor \neg \left(y \leq 2.15 \cdot 10^{-113}\right):\\
\;\;\;\;y \cdot \left(z \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t + 0.125 \cdot x\\
\end{array}
\end{array}
if y < -3.10000000000000012e187 or 2.15e-113 < y Initial program 99.3%
metadata-eval99.3%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around 0 80.5%
*-commutative80.5%
associate-*l*81.2%
Simplified81.2%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
associate-*r*60.0%
*-commutative60.0%
Simplified60.0%
if -3.10000000000000012e187 < y < 2.15e-113Initial program 100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around inf 76.8%
Final simplification69.6%
(FPCore (x y z t) :precision binary64 (if (<= t -4.9e+54) t (if (<= t 4.8e-5) (* 0.125 x) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.9e+54) {
tmp = t;
} else if (t <= 4.8e-5) {
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 <= (-4.9d+54)) then
tmp = t
else if (t <= 4.8d-5) 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 <= -4.9e+54) {
tmp = t;
} else if (t <= 4.8e-5) {
tmp = 0.125 * x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4.9e+54: tmp = t elif t <= 4.8e-5: tmp = 0.125 * x else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4.9e+54) tmp = t; elseif (t <= 4.8e-5) 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 <= -4.9e+54) tmp = t; elseif (t <= 4.8e-5) tmp = 0.125 * x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.9e+54], t, If[LessEqual[t, 4.8e-5], N[(0.125 * x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.9 \cdot 10^{+54}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-5}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if t < -4.90000000000000001e54 or 4.8000000000000001e-5 < t Initial program 100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 60.8%
if -4.90000000000000001e54 < t < 4.8000000000000001e-5Initial program 99.4%
metadata-eval99.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 90.4%
Taylor expanded in x around inf 48.1%
Final simplification53.6%
(FPCore (x y z t) :precision binary64 (+ t (- (* 0.125 x) (/ y (/ 2.0 z)))))
double code(double x, double y, double z, double t) {
return t + ((0.125 * x) - (y / (2.0 / z)));
}
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 / (2.0d0 / z)))
end function
public static double code(double x, double y, double z, double t) {
return t + ((0.125 * x) - (y / (2.0 / z)));
}
def code(x, y, z, t): return t + ((0.125 * x) - (y / (2.0 / z)))
function code(x, y, z, t) return Float64(t + Float64(Float64(0.125 * x) - Float64(y / Float64(2.0 / z)))) end
function tmp = code(x, y, z, t) tmp = t + ((0.125 * x) - (y / (2.0 / z))); end
code[x_, y_, z_, t_] := N[(t + N[(N[(0.125 * x), $MachinePrecision] - N[(y / N[(2.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \left(0.125 \cdot x - \frac{y}{\frac{2}{z}}\right)
\end{array}
Initial program 99.7%
metadata-eval99.7%
associate-/l*99.9%
Simplified99.9%
Final simplification99.9%
(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 99.7%
metadata-eval99.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 32.2%
Final simplification32.2%
(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 2024019
(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))