
(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 10 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 0.125 x (fma (/ y -2.0) z t)))
double code(double x, double y, double z, double t) {
return fma(0.125, x, fma((y / -2.0), z, t));
}
function code(x, y, z, t) return fma(0.125, x, fma(Float64(y / -2.0), z, t)) end
code[x_, y_, z_, t_] := N[(0.125 * x + N[(N[(y / -2.0), $MachinePrecision] * z + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(0.125, x, \mathsf{fma}\left(\frac{y}{-2}, z, t\right)\right)
\end{array}
Initial program 100.0%
sub-neg100.0%
associate-+l+100.0%
fma-def100.0%
metadata-eval100.0%
associate-/l*99.9%
distribute-frac-neg99.9%
associate-/r/100.0%
fma-def100.0%
neg-mul-1100.0%
*-commutative100.0%
associate-/l*100.0%
metadata-eval100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (x y z t)
:precision binary64
(if (or (<= (* y z) -1e-112)
(not
(or (<= (* y z) 1e-33)
(and (not (<= (* y z) 1e-11)) (<= (* y z) 2e+61)))))
(- t (* (* y z) 0.5))
(+ t (* 0.125 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (((y * z) <= -1e-112) || !(((y * z) <= 1e-33) || (!((y * z) <= 1e-11) && ((y * z) <= 2e+61)))) {
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 (((y * z) <= (-1d-112)) .or. (.not. ((y * z) <= 1d-33) .or. (.not. ((y * z) <= 1d-11)) .and. ((y * z) <= 2d+61))) 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 (((y * z) <= -1e-112) || !(((y * z) <= 1e-33) || (!((y * z) <= 1e-11) && ((y * z) <= 2e+61)))) {
tmp = t - ((y * z) * 0.5);
} else {
tmp = t + (0.125 * x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((y * z) <= -1e-112) or not (((y * z) <= 1e-33) or (not ((y * z) <= 1e-11) and ((y * z) <= 2e+61))): tmp = t - ((y * z) * 0.5) else: tmp = t + (0.125 * x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(y * z) <= -1e-112) || !((Float64(y * z) <= 1e-33) || (!(Float64(y * z) <= 1e-11) && (Float64(y * z) <= 2e+61)))) tmp = Float64(t - Float64(Float64(y * 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 * z) <= -1e-112) || ~((((y * z) <= 1e-33) || (~(((y * z) <= 1e-11)) && ((y * z) <= 2e+61))))) 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[N[(y * z), $MachinePrecision], -1e-112], N[Not[Or[LessEqual[N[(y * z), $MachinePrecision], 1e-33], And[N[Not[LessEqual[N[(y * z), $MachinePrecision], 1e-11]], $MachinePrecision], LessEqual[N[(y * z), $MachinePrecision], 2e+61]]]], $MachinePrecision]], N[(t - N[(N[(y * z), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], N[(t + N[(0.125 * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot z \leq -1 \cdot 10^{-112} \lor \neg \left(y \cdot z \leq 10^{-33} \lor \neg \left(y \cdot z \leq 10^{-11}\right) \land y \cdot z \leq 2 \cdot 10^{+61}\right):\\
\;\;\;\;t - \left(y \cdot z\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;t + 0.125 \cdot x\\
\end{array}
\end{array}
if (*.f64 y z) < -9.9999999999999995e-113 or 1.0000000000000001e-33 < (*.f64 y z) < 9.99999999999999939e-12 or 1.9999999999999999e61 < (*.f64 y z) Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 83.3%
if -9.9999999999999995e-113 < (*.f64 y z) < 1.0000000000000001e-33 or 9.99999999999999939e-12 < (*.f64 y z) < 1.9999999999999999e61Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around 0 96.8%
Final simplification89.5%
(FPCore (x y z t)
:precision binary64
(if (or (<= z -26500000000000.0)
(not
(or (<= z 1.05e+94)
(and (not (<= z 2.1e+136))
(or (<= z 6.6e+180)
(and (not (<= z 5e+232)) (<= z 9e+244)))))))
(* (/ y -2.0) z)
(+ t (* 0.125 x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -26500000000000.0) || !((z <= 1.05e+94) || (!(z <= 2.1e+136) && ((z <= 6.6e+180) || (!(z <= 5e+232) && (z <= 9e+244)))))) {
tmp = (y / -2.0) * z;
} 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 <= (-26500000000000.0d0)) .or. (.not. (z <= 1.05d+94) .or. (.not. (z <= 2.1d+136)) .and. (z <= 6.6d+180) .or. (.not. (z <= 5d+232)) .and. (z <= 9d+244))) then
tmp = (y / (-2.0d0)) * z
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 <= -26500000000000.0) || !((z <= 1.05e+94) || (!(z <= 2.1e+136) && ((z <= 6.6e+180) || (!(z <= 5e+232) && (z <= 9e+244)))))) {
tmp = (y / -2.0) * z;
} else {
tmp = t + (0.125 * x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -26500000000000.0) or not ((z <= 1.05e+94) or (not (z <= 2.1e+136) and ((z <= 6.6e+180) or (not (z <= 5e+232) and (z <= 9e+244))))): tmp = (y / -2.0) * z else: tmp = t + (0.125 * x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -26500000000000.0) || !((z <= 1.05e+94) || (!(z <= 2.1e+136) && ((z <= 6.6e+180) || (!(z <= 5e+232) && (z <= 9e+244)))))) tmp = Float64(Float64(y / -2.0) * z); 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 <= -26500000000000.0) || ~(((z <= 1.05e+94) || (~((z <= 2.1e+136)) && ((z <= 6.6e+180) || (~((z <= 5e+232)) && (z <= 9e+244))))))) tmp = (y / -2.0) * z; else tmp = t + (0.125 * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -26500000000000.0], N[Not[Or[LessEqual[z, 1.05e+94], And[N[Not[LessEqual[z, 2.1e+136]], $MachinePrecision], Or[LessEqual[z, 6.6e+180], And[N[Not[LessEqual[z, 5e+232]], $MachinePrecision], LessEqual[z, 9e+244]]]]]], $MachinePrecision]], N[(N[(y / -2.0), $MachinePrecision] * z), $MachinePrecision], N[(t + N[(0.125 * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -26500000000000 \lor \neg \left(z \leq 1.05 \cdot 10^{+94} \lor \neg \left(z \leq 2.1 \cdot 10^{+136}\right) \land \left(z \leq 6.6 \cdot 10^{+180} \lor \neg \left(z \leq 5 \cdot 10^{+232}\right) \land z \leq 9 \cdot 10^{+244}\right)\right):\\
\;\;\;\;\frac{y}{-2} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t + 0.125 \cdot x\\
\end{array}
\end{array}
if z < -2.65e13 or 1.04999999999999995e94 < z < 2.0999999999999999e136 or 6.59999999999999978e180 < z < 4.99999999999999987e232 or 9.0000000000000005e244 < z Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 66.0%
metadata-eval66.0%
/-rgt-identity66.0%
associate-/r/65.9%
times-frac65.9%
*-lft-identity65.9%
associate-/l/65.9%
associate-/r/66.0%
/-rgt-identity66.0%
associate-*l/66.0%
*-commutative66.0%
Simplified66.0%
if -2.65e13 < z < 1.04999999999999995e94 or 2.0999999999999999e136 < z < 6.59999999999999978e180 or 4.99999999999999987e232 < z < 9.0000000000000005e244Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 80.5%
Final simplification76.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (* y z) 0.5)))
(if (or (<= x -5.2e+102) (not (<= x 1.65e-63)))
(- (* 0.125 x) t_1)
(- t t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y * z) * 0.5;
double tmp;
if ((x <= -5.2e+102) || !(x <= 1.65e-63)) {
tmp = (0.125 * x) - t_1;
} else {
tmp = t - 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 = (y * z) * 0.5d0
if ((x <= (-5.2d+102)) .or. (.not. (x <= 1.65d-63))) then
tmp = (0.125d0 * x) - t_1
else
tmp = t - t_1
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 ((x <= -5.2e+102) || !(x <= 1.65e-63)) {
tmp = (0.125 * x) - t_1;
} else {
tmp = t - t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * z) * 0.5 tmp = 0 if (x <= -5.2e+102) or not (x <= 1.65e-63): tmp = (0.125 * x) - t_1 else: tmp = t - t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * z) * 0.5) tmp = 0.0 if ((x <= -5.2e+102) || !(x <= 1.65e-63)) tmp = Float64(Float64(0.125 * x) - t_1); else tmp = Float64(t - t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * z) * 0.5; tmp = 0.0; if ((x <= -5.2e+102) || ~((x <= 1.65e-63))) tmp = (0.125 * x) - t_1; else tmp = t - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] * 0.5), $MachinePrecision]}, If[Or[LessEqual[x, -5.2e+102], N[Not[LessEqual[x, 1.65e-63]], $MachinePrecision]], N[(N[(0.125 * x), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t - t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y \cdot z\right) \cdot 0.5\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{+102} \lor \neg \left(x \leq 1.65 \cdot 10^{-63}\right):\\
\;\;\;\;0.125 \cdot x - t_1\\
\mathbf{else}:\\
\;\;\;\;t - t_1\\
\end{array}
\end{array}
if x < -5.20000000000000013e102 or 1.64999999999999997e-63 < x Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around 0 83.1%
if -5.20000000000000013e102 < x < 1.64999999999999997e-63Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 90.5%
Final simplification87.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ y -2.0) z)))
(if (<= y -4.3e+83)
t_1
(if (<= y -2.75e-260) t (if (<= y 1.7e-59) (* 0.125 x) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y / -2.0) * z;
double tmp;
if (y <= -4.3e+83) {
tmp = t_1;
} else if (y <= -2.75e-260) {
tmp = t;
} else if (y <= 1.7e-59) {
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 = (y / (-2.0d0)) * z
if (y <= (-4.3d+83)) then
tmp = t_1
else if (y <= (-2.75d-260)) then
tmp = t
else if (y <= 1.7d-59) 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 = (y / -2.0) * z;
double tmp;
if (y <= -4.3e+83) {
tmp = t_1;
} else if (y <= -2.75e-260) {
tmp = t;
} else if (y <= 1.7e-59) {
tmp = 0.125 * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / -2.0) * z tmp = 0 if y <= -4.3e+83: tmp = t_1 elif y <= -2.75e-260: tmp = t elif y <= 1.7e-59: tmp = 0.125 * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / -2.0) * z) tmp = 0.0 if (y <= -4.3e+83) tmp = t_1; elseif (y <= -2.75e-260) tmp = t; elseif (y <= 1.7e-59) tmp = Float64(0.125 * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / -2.0) * z; tmp = 0.0; if (y <= -4.3e+83) tmp = t_1; elseif (y <= -2.75e-260) tmp = t; elseif (y <= 1.7e-59) tmp = 0.125 * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / -2.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[y, -4.3e+83], t$95$1, If[LessEqual[y, -2.75e-260], t, If[LessEqual[y, 1.7e-59], N[(0.125 * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{-2} \cdot z\\
\mathbf{if}\;y \leq -4.3 \cdot 10^{+83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -2.75 \cdot 10^{-260}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-59}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -4.3e83 or 1.70000000000000009e-59 < y Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 53.7%
metadata-eval53.7%
/-rgt-identity53.7%
associate-/r/53.6%
times-frac53.6%
*-lft-identity53.6%
associate-/l/53.6%
associate-/r/53.7%
/-rgt-identity53.7%
associate-*l/53.7%
*-commutative53.7%
Simplified53.7%
if -4.3e83 < y < -2.75000000000000012e-260Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 50.5%
if -2.75000000000000012e-260 < y < 1.70000000000000009e-59Initial program 99.9%
sub-neg99.9%
sub-neg99.9%
metadata-eval99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 50.8%
Final simplification52.2%
(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 100.0%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*99.9%
Simplified99.9%
Final simplification99.9%
(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(Float64(y * 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[(N[(y * z), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \left(0.125 \cdot x - \frac{y \cdot z}{2}\right)
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1e+88) (not (<= x 2.65e-55))) (* 0.125 x) t))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1e+88) || !(x <= 2.65e-55)) {
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 ((x <= (-1d+88)) .or. (.not. (x <= 2.65d-55))) 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 ((x <= -1e+88) || !(x <= 2.65e-55)) {
tmp = 0.125 * x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1e+88) or not (x <= 2.65e-55): tmp = 0.125 * x else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1e+88) || !(x <= 2.65e-55)) tmp = Float64(0.125 * x); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1e+88) || ~((x <= 2.65e-55))) tmp = 0.125 * x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1e+88], N[Not[LessEqual[x, 2.65e-55]], $MachinePrecision]], N[(0.125 * x), $MachinePrecision], t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+88} \lor \neg \left(x \leq 2.65 \cdot 10^{-55}\right):\\
\;\;\;\;0.125 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if x < -9.99999999999999959e87 or 2.6500000000000001e-55 < x Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in x around inf 61.7%
if -9.99999999999999959e87 < x < 2.6500000000000001e-55Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 47.9%
Final simplification53.8%
(FPCore (x y z t) :precision binary64 0.0)
double code(double x, double y, double z, double t) {
return 0.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 = 0.0d0
end function
public static double code(double x, double y, double z, double t) {
return 0.0;
}
def code(x, y, z, t): return 0.0
function code(x, y, z, t) return 0.0 end
function tmp = code(x, y, z, t) tmp = 0.0; end
code[x_, y_, z_, t_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 100.0%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 35.1%
metadata-eval35.1%
/-rgt-identity35.1%
associate-/r/35.0%
times-frac35.0%
*-lft-identity35.0%
associate-/l/35.0%
associate-/r/35.1%
/-rgt-identity35.1%
associate-*l/35.1%
*-commutative35.1%
Simplified35.1%
Taylor expanded in z around 0 35.1%
Simplified2.4%
Final simplification2.4%
(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%
sub-neg100.0%
sub-neg100.0%
metadata-eval100.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 35.0%
Final simplification35.0%
(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 2023320
(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))