
(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 7 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) (+ t (/ (* y z) -2.0))))
double code(double x, double y, double z, double t) {
return (0.125 * x) + (t + ((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 = (0.125d0 * x) + (t + ((y * z) / (-2.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (0.125 * x) + (t + ((y * z) / -2.0));
}
def code(x, y, z, t): return (0.125 * x) + (t + ((y * z) / -2.0))
function code(x, y, z, t) return Float64(Float64(0.125 * x) + Float64(t + Float64(Float64(y * z) / -2.0))) end
function tmp = code(x, y, z, t) tmp = (0.125 * x) + (t + ((y * z) / -2.0)); end
code[x_, y_, z_, t_] := N[(N[(0.125 * x), $MachinePrecision] + N[(t + N[(N[(y * z), $MachinePrecision] / -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.125 \cdot x + \left(t + \frac{y \cdot z}{-2}\right)
\end{array}
Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (* y z) -0.5)))
(if (<= (* y z) -2.8e+180)
t_1
(if (<= (* y z) -2.75e-260)
t
(if (<= (* y z) 2.7e+28) (* 0.125 x) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (y * z) * -0.5;
double tmp;
if ((y * z) <= -2.8e+180) {
tmp = t_1;
} else if ((y * z) <= -2.75e-260) {
tmp = t;
} else if ((y * z) <= 2.7e+28) {
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 * z) * (-0.5d0)
if ((y * z) <= (-2.8d+180)) then
tmp = t_1
else if ((y * z) <= (-2.75d-260)) then
tmp = t
else if ((y * z) <= 2.7d+28) 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 * z) * -0.5;
double tmp;
if ((y * z) <= -2.8e+180) {
tmp = t_1;
} else if ((y * z) <= -2.75e-260) {
tmp = t;
} else if ((y * z) <= 2.7e+28) {
tmp = 0.125 * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * z) * -0.5 tmp = 0 if (y * z) <= -2.8e+180: tmp = t_1 elif (y * z) <= -2.75e-260: tmp = t elif (y * z) <= 2.7e+28: tmp = 0.125 * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * z) * -0.5) tmp = 0.0 if (Float64(y * z) <= -2.8e+180) tmp = t_1; elseif (Float64(y * z) <= -2.75e-260) tmp = t; elseif (Float64(y * z) <= 2.7e+28) tmp = Float64(0.125 * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * z) * -0.5; tmp = 0.0; if ((y * z) <= -2.8e+180) tmp = t_1; elseif ((y * z) <= -2.75e-260) tmp = t; elseif ((y * z) <= 2.7e+28) 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 * z), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[N[(y * z), $MachinePrecision], -2.8e+180], t$95$1, If[LessEqual[N[(y * z), $MachinePrecision], -2.75e-260], t, If[LessEqual[N[(y * z), $MachinePrecision], 2.7e+28], N[(0.125 * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y \cdot z\right) \cdot -0.5\\
\mathbf{if}\;y \cdot z \leq -2.8 \cdot 10^{+180}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot z \leq -2.75 \cdot 10^{-260}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \cdot z \leq 2.7 \cdot 10^{+28}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 y z) < -2.80000000000000012e180 or 2.7000000000000002e28 < (*.f64 y z) Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
*-lowering-*.f6481.6%
Simplified81.6%
if -2.80000000000000012e180 < (*.f64 y z) < -2.75000000000000012e-260Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t around inf
Simplified48.4%
if -2.75000000000000012e-260 < (*.f64 y z) < 2.7000000000000002e28Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf
*-lowering-*.f6457.4%
Simplified57.4%
Final simplification63.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ t (* (* y z) -0.5))))
(if (<= (* y z) -5e+82)
t_1
(if (<= (* y z) 5e+17) (- t (* x -0.125)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = t + ((y * z) * -0.5);
double tmp;
if ((y * z) <= -5e+82) {
tmp = t_1;
} else if ((y * z) <= 5e+17) {
tmp = t - (x * -0.125);
} 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 = t + ((y * z) * (-0.5d0))
if ((y * z) <= (-5d+82)) then
tmp = t_1
else if ((y * z) <= 5d+17) then
tmp = t - (x * (-0.125d0))
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 = t + ((y * z) * -0.5);
double tmp;
if ((y * z) <= -5e+82) {
tmp = t_1;
} else if ((y * z) <= 5e+17) {
tmp = t - (x * -0.125);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t + ((y * z) * -0.5) tmp = 0 if (y * z) <= -5e+82: tmp = t_1 elif (y * z) <= 5e+17: tmp = t - (x * -0.125) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t + Float64(Float64(y * z) * -0.5)) tmp = 0.0 if (Float64(y * z) <= -5e+82) tmp = t_1; elseif (Float64(y * z) <= 5e+17) tmp = Float64(t - Float64(x * -0.125)); else tmp = t_1; 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) <= -5e+82) tmp = t_1; elseif ((y * z) <= 5e+17) tmp = t - (x * -0.125); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t + N[(N[(y * z), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * z), $MachinePrecision], -5e+82], t$95$1, If[LessEqual[N[(y * z), $MachinePrecision], 5e+17], N[(t - N[(x * -0.125), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(y \cdot z\right) \cdot -0.5\\
\mathbf{if}\;y \cdot z \leq -5 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot z \leq 5 \cdot 10^{+17}:\\
\;\;\;\;t - x \cdot -0.125\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 y z) < -5.00000000000000015e82 or 5e17 < (*.f64 y z) Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6492.9%
Simplified92.9%
if -5.00000000000000015e82 < (*.f64 y z) < 5e17Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0
remove-double-negN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval90.7%
Simplified90.7%
Final simplification91.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (* y z) -0.5)))
(if (<= t -4.5e+60)
(+ t t_1)
(if (<= t 8.4e+77) (+ (* 0.125 x) t_1) (- t (* x -0.125))))))
double code(double x, double y, double z, double t) {
double t_1 = (y * z) * -0.5;
double tmp;
if (t <= -4.5e+60) {
tmp = t + t_1;
} else if (t <= 8.4e+77) {
tmp = (0.125 * x) + t_1;
} else {
tmp = t - (x * -0.125);
}
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 <= (-4.5d+60)) then
tmp = t + t_1
else if (t <= 8.4d+77) then
tmp = (0.125d0 * x) + t_1
else
tmp = t - (x * (-0.125d0))
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 <= -4.5e+60) {
tmp = t + t_1;
} else if (t <= 8.4e+77) {
tmp = (0.125 * x) + t_1;
} else {
tmp = t - (x * -0.125);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * z) * -0.5 tmp = 0 if t <= -4.5e+60: tmp = t + t_1 elif t <= 8.4e+77: tmp = (0.125 * x) + t_1 else: tmp = t - (x * -0.125) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * z) * -0.5) tmp = 0.0 if (t <= -4.5e+60) tmp = Float64(t + t_1); elseif (t <= 8.4e+77) tmp = Float64(Float64(0.125 * x) + t_1); else tmp = Float64(t - Float64(x * -0.125)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * z) * -0.5; tmp = 0.0; if (t <= -4.5e+60) tmp = t + t_1; elseif (t <= 8.4e+77) tmp = (0.125 * x) + t_1; else tmp = t - (x * -0.125); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y * z), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[t, -4.5e+60], N[(t + t$95$1), $MachinePrecision], If[LessEqual[t, 8.4e+77], N[(N[(0.125 * x), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t - N[(x * -0.125), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y \cdot z\right) \cdot -0.5\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+60}:\\
\;\;\;\;t + t\_1\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{+77}:\\
\;\;\;\;0.125 \cdot x + t\_1\\
\mathbf{else}:\\
\;\;\;\;t - x \cdot -0.125\\
\end{array}
\end{array}
if t < -4.50000000000000013e60Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6487.6%
Simplified87.6%
if -4.50000000000000013e60 < t < 8.3999999999999995e77Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t around 0
*-lowering-*.f64N/A
*-lowering-*.f6494.0%
Simplified94.0%
if 8.3999999999999995e77 < t Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0
remove-double-negN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval89.3%
Simplified89.3%
Final simplification91.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (* y z) -0.5)))
(if (<= (* y z) -4e+180)
t_1
(if (<= (* y z) 1e+29) (- t (* x -0.125)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y * z) * -0.5;
double tmp;
if ((y * z) <= -4e+180) {
tmp = t_1;
} else if ((y * z) <= 1e+29) {
tmp = t - (x * -0.125);
} 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 * z) * (-0.5d0)
if ((y * z) <= (-4d+180)) then
tmp = t_1
else if ((y * z) <= 1d+29) then
tmp = t - (x * (-0.125d0))
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 * z) * -0.5;
double tmp;
if ((y * z) <= -4e+180) {
tmp = t_1;
} else if ((y * z) <= 1e+29) {
tmp = t - (x * -0.125);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y * z) * -0.5 tmp = 0 if (y * z) <= -4e+180: tmp = t_1 elif (y * z) <= 1e+29: tmp = t - (x * -0.125) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y * z) * -0.5) tmp = 0.0 if (Float64(y * z) <= -4e+180) tmp = t_1; elseif (Float64(y * z) <= 1e+29) tmp = Float64(t - Float64(x * -0.125)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y * z) * -0.5; tmp = 0.0; if ((y * z) <= -4e+180) tmp = t_1; elseif ((y * z) <= 1e+29) tmp = t - (x * -0.125); else tmp = 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[LessEqual[N[(y * z), $MachinePrecision], -4e+180], t$95$1, If[LessEqual[N[(y * z), $MachinePrecision], 1e+29], N[(t - N[(x * -0.125), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y \cdot z\right) \cdot -0.5\\
\mathbf{if}\;y \cdot z \leq -4 \cdot 10^{+180}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \cdot z \leq 10^{+29}:\\
\;\;\;\;t - x \cdot -0.125\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 y z) < -4e180 or 9.99999999999999914e28 < (*.f64 y z) Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf
*-lowering-*.f64N/A
*-lowering-*.f6482.4%
Simplified82.4%
if -4e180 < (*.f64 y z) < 9.99999999999999914e28Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0
remove-double-negN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
mul-1-negN/A
distribute-lft-neg-inN/A
*-commutativeN/A
*-lowering-*.f64N/A
metadata-eval87.6%
Simplified87.6%
Final simplification85.7%
(FPCore (x y z t) :precision binary64 (if (<= t -4.6e+32) t (if (<= t 6.5e+31) (* 0.125 x) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4.6e+32) {
tmp = t;
} else if (t <= 6.5e+31) {
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.6d+32)) then
tmp = t
else if (t <= 6.5d+31) 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.6e+32) {
tmp = t;
} else if (t <= 6.5e+31) {
tmp = 0.125 * x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4.6e+32: tmp = t elif t <= 6.5e+31: tmp = 0.125 * x else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4.6e+32) tmp = t; elseif (t <= 6.5e+31) 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.6e+32) tmp = t; elseif (t <= 6.5e+31) tmp = 0.125 * x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4.6e+32], t, If[LessEqual[t, 6.5e+31], N[(0.125 * x), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.6 \cdot 10^{+32}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+31}:\\
\;\;\;\;0.125 \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if t < -4.5999999999999999e32 or 6.5000000000000004e31 < t Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t around inf
Simplified61.3%
if -4.5999999999999999e32 < t < 6.5000000000000004e31Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around inf
*-lowering-*.f6446.7%
Simplified46.7%
(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-negN/A
associate-+l+N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
distribute-neg-frac2N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t around inf
Simplified31.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 2024160
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, B"
:precision binary64
:alt
(! :herbie-platform default (- (+ (/ x 8) t) (* (/ z 2) y)))
(+ (- (* (/ 1.0 8.0) x) (/ (* y z) 2.0)) t))