
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.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 - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.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 - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t) :precision binary64 (if (<= t -6e+49) (fma (/ -1.0 z) (* y 0.3333333333333333) (+ x (/ t (* y (* z 3.0))))) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -6e+49) {
tmp = fma((-1.0 / z), (y * 0.3333333333333333), (x + (t / (y * (z * 3.0)))));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= -6e+49) tmp = fma(Float64(-1.0 / z), Float64(y * 0.3333333333333333), Float64(x + Float64(t / Float64(y * Float64(z * 3.0))))); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, -6e+49], N[(N[(-1.0 / z), $MachinePrecision] * N[(y * 0.3333333333333333), $MachinePrecision] + N[(x + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{z}, y \cdot 0.3333333333333333, x + \frac{t}{y \cdot \left(z \cdot 3\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if t < -6.0000000000000005e49Initial program 98.0%
lift-*.f64N/A
lift-/.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l+N/A
lift-/.f64N/A
distribute-neg-fracN/A
neg-mul-1N/A
lift-*.f64N/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower-+.f6498.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.1
Applied egg-rr98.1%
if -6.0000000000000005e49 < t Initial program 94.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6497.5
Applied egg-rr97.5%
Final simplification97.6%
(FPCore (x y z t) :precision binary64 (if (<= t -2.5e-32) (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.5e-32) {
tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
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-32)) then
tmp = (x - (y / (z * 3.0d0))) + (t / (y * (z * 3.0d0)))
else
tmp = x + (((t / y) - y) / (z * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.5e-32) {
tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.5e-32: tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))) else: tmp = x + (((t / y) - y) / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.5e-32) tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.5e-32) tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))); else tmp = x + (((t / y) - y) / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.5e-32], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-32}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if t < -2.5e-32Initial program 98.4%
if -2.5e-32 < t Initial program 93.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6497.3
Applied egg-rr97.3%
Final simplification97.6%
(FPCore (x y z t) :precision binary64 (if (<= t -5.4e+49) (fma (/ t (* z y)) 0.3333333333333333 (fma y (/ -0.3333333333333333 z) x)) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.4e+49) {
tmp = fma((t / (z * y)), 0.3333333333333333, fma(y, (-0.3333333333333333 / z), x));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= -5.4e+49) tmp = fma(Float64(t / Float64(z * y)), 0.3333333333333333, fma(y, Float64(-0.3333333333333333 / z), x)); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.4e+49], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.4 \cdot 10^{+49}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z \cdot y}, 0.3333333333333333, \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if t < -5.4000000000000002e49Initial program 98.0%
lift-*.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-rgt-identityN/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
metadata-eval97.9
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied egg-rr97.9%
if -5.4000000000000002e49 < t Initial program 94.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6497.5
Applied egg-rr97.5%
Final simplification97.6%
(FPCore (x y z t) :precision binary64 (if (<= (* z 3.0) -1e-71) (+ x (/ -0.3333333333333333 z)) (if (<= (* z 3.0) 4e-71) (- (/ y z)) (+ x (/ 1.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -1e-71) {
tmp = x + (-0.3333333333333333 / z);
} else if ((z * 3.0) <= 4e-71) {
tmp = -(y / z);
} else {
tmp = x + (1.0 / z);
}
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.0d0) <= (-1d-71)) then
tmp = x + ((-0.3333333333333333d0) / z)
else if ((z * 3.0d0) <= 4d-71) then
tmp = -(y / z)
else
tmp = x + (1.0d0 / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -1e-71) {
tmp = x + (-0.3333333333333333 / z);
} else if ((z * 3.0) <= 4e-71) {
tmp = -(y / z);
} else {
tmp = x + (1.0 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -1e-71: tmp = x + (-0.3333333333333333 / z) elif (z * 3.0) <= 4e-71: tmp = -(y / z) else: tmp = x + (1.0 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -1e-71) tmp = Float64(x + Float64(-0.3333333333333333 / z)); elseif (Float64(z * 3.0) <= 4e-71) tmp = Float64(-Float64(y / z)); else tmp = Float64(x + Float64(1.0 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -1e-71) tmp = x + (-0.3333333333333333 / z); elseif ((z * 3.0) <= 4e-71) tmp = -(y / z); else tmp = x + (1.0 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -1e-71], N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * 3.0), $MachinePrecision], 4e-71], (-N[(y / z), $MachinePrecision]), N[(x + N[(1.0 / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-71}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;z \cdot 3 \leq 4 \cdot 10^{-71}:\\
\;\;\;\;-\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{z}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -9.9999999999999992e-72Initial program 96.6%
Taylor expanded in t around 0
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6443.1
Simplified43.1%
if -9.9999999999999992e-72 < (*.f64 z #s(literal 3 binary64)) < 3.9999999999999997e-71Initial program 90.3%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6447.2
Simplified47.2%
Taylor expanded in y around -inf
mul-1-negN/A
lower-neg.f6433.3
Simplified33.3%
if 3.9999999999999997e-71 < (*.f64 z #s(literal 3 binary64)) Initial program 99.7%
Taylor expanded in t around 0
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6441.1
Simplified41.1%
Taylor expanded in z around 0
lower-/.f6441.4
Simplified41.4%
Final simplification38.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ x (/ -0.3333333333333333 z)))) (if (<= (* z 3.0) -1e-71) t_1 (if (<= (* z 3.0) 4e-71) (- (/ y z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (-0.3333333333333333 / z);
double tmp;
if ((z * 3.0) <= -1e-71) {
tmp = t_1;
} else if ((z * 3.0) <= 4e-71) {
tmp = -(y / z);
} 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 = x + ((-0.3333333333333333d0) / z)
if ((z * 3.0d0) <= (-1d-71)) then
tmp = t_1
else if ((z * 3.0d0) <= 4d-71) then
tmp = -(y / z)
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 = x + (-0.3333333333333333 / z);
double tmp;
if ((z * 3.0) <= -1e-71) {
tmp = t_1;
} else if ((z * 3.0) <= 4e-71) {
tmp = -(y / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (-0.3333333333333333 / z) tmp = 0 if (z * 3.0) <= -1e-71: tmp = t_1 elif (z * 3.0) <= 4e-71: tmp = -(y / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(-0.3333333333333333 / z)) tmp = 0.0 if (Float64(z * 3.0) <= -1e-71) tmp = t_1; elseif (Float64(z * 3.0) <= 4e-71) tmp = Float64(-Float64(y / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (-0.3333333333333333 / z); tmp = 0.0; if ((z * 3.0) <= -1e-71) tmp = t_1; elseif ((z * 3.0) <= 4e-71) tmp = -(y / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * 3.0), $MachinePrecision], -1e-71], t$95$1, If[LessEqual[N[(z * 3.0), $MachinePrecision], 4e-71], (-N[(y / z), $MachinePrecision]), t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{-0.3333333333333333}{z}\\
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot 3 \leq 4 \cdot 10^{-71}:\\
\;\;\;\;-\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -9.9999999999999992e-72 or 3.9999999999999997e-71 < (*.f64 z #s(literal 3 binary64)) Initial program 98.0%
Taylor expanded in t around 0
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6442.2
Simplified42.2%
if -9.9999999999999992e-72 < (*.f64 z #s(literal 3 binary64)) < 3.9999999999999997e-71Initial program 90.3%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6447.2
Simplified47.2%
Taylor expanded in y around -inf
mul-1-negN/A
lower-neg.f6433.3
Simplified33.3%
Final simplification38.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -9e-8)
(/ (* y -0.3333333333333333) z)
(if (<= y 7.6e-247)
(+ x (/ -0.3333333333333333 z))
(if (<= y 7.5e+42)
(fma t (/ -0.3333333333333333 y) x)
(/ y (* z -3.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-8) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 7.6e-247) {
tmp = x + (-0.3333333333333333 / z);
} else if (y <= 7.5e+42) {
tmp = fma(t, (-0.3333333333333333 / y), x);
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -9e-8) tmp = Float64(Float64(y * -0.3333333333333333) / z); elseif (y <= 7.6e-247) tmp = Float64(x + Float64(-0.3333333333333333 / z)); elseif (y <= 7.5e+42) tmp = fma(t, Float64(-0.3333333333333333 / y), x); else tmp = Float64(y / Float64(z * -3.0)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e-8], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 7.6e-247], N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+42], N[(t * N[(-0.3333333333333333 / y), $MachinePrecision] + x), $MachinePrecision], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-8}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-247}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{-0.3333333333333333}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -8.99999999999999986e-8Initial program 99.7%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6476.9
Simplified76.9%
if -8.99999999999999986e-8 < y < 7.59999999999999977e-247Initial program 90.3%
Taylor expanded in t around 0
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6435.1
Simplified35.1%
if 7.59999999999999977e-247 < y < 7.50000000000000041e42Initial program 95.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6493.5
Applied egg-rr93.5%
Taylor expanded in y around 0
div-subN/A
associate-*l/N/A
remove-double-negN/A
distribute-lft-neg-outN/A
mul-1-negN/A
associate-/l*N/A
associate-/l/N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
remove-double-negN/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
Simplified91.9%
Taylor expanded in z around -inf
lower-/.f6445.7
Simplified45.7%
if 7.50000000000000041e42 < y Initial program 98.0%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.6
Simplified82.6%
associate-/l*N/A
clear-numN/A
div-invN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.7
Applied egg-rr82.7%
Final simplification56.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.4e-7)
(fma y (/ -0.3333333333333333 z) x)
(if (<= y 2e+42)
(fma t (/ 0.3333333333333333 (* z y)) x)
(fma -1.0 (/ y (* z 3.0)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.4e-7) {
tmp = fma(y, (-0.3333333333333333 / z), x);
} else if (y <= 2e+42) {
tmp = fma(t, (0.3333333333333333 / (z * y)), x);
} else {
tmp = fma(-1.0, (y / (z * 3.0)), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -3.4e-7) tmp = fma(y, Float64(-0.3333333333333333 / z), x); elseif (y <= 2e+42) tmp = fma(t, Float64(0.3333333333333333 / Float64(z * y)), x); else tmp = fma(-1.0, Float64(y / Float64(z * 3.0)), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.4e-7], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 2e+42], N[(t * N[(0.3333333333333333 / N[(z * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(-1.0 * N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+42}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{0.3333333333333333}{z \cdot y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{y}{z \cdot 3}, x\right)\\
\end{array}
\end{array}
if y < -3.39999999999999974e-7Initial program 99.7%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6493.4
Simplified93.4%
if -3.39999999999999974e-7 < y < 2.00000000000000009e42Initial program 92.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6492.2
Applied egg-rr92.2%
Taylor expanded in y around 0
div-subN/A
associate-*l/N/A
remove-double-negN/A
distribute-lft-neg-outN/A
mul-1-negN/A
associate-/l*N/A
associate-/l/N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-lft-identityN/A
associate-*l/N/A
associate-*l*N/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-outN/A
remove-double-negN/A
associate-*l/N/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
Simplified90.0%
if 2.00000000000000009e42 < y Initial program 98.1%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6495.8
Simplified95.8%
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-*l/N/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
neg-mul-1N/A
times-fracN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6495.9
Applied egg-rr95.9%
Final simplification92.0%
(FPCore (x y z t) :precision binary64 (if (<= y -1e-124) (fma y (/ -0.3333333333333333 z) x) (if (<= y 7.6e-13) (/ t (* 3.0 (* z y))) (fma -1.0 (/ y (* z 3.0)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1e-124) {
tmp = fma(y, (-0.3333333333333333 / z), x);
} else if (y <= 7.6e-13) {
tmp = t / (3.0 * (z * y));
} else {
tmp = fma(-1.0, (y / (z * 3.0)), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1e-124) tmp = fma(y, Float64(-0.3333333333333333 / z), x); elseif (y <= 7.6e-13) tmp = Float64(t / Float64(3.0 * Float64(z * y))); else tmp = fma(-1.0, Float64(y / Float64(z * 3.0)), x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -1e-124], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 7.6e-13], N[(t / N[(3.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-124}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-13}:\\
\;\;\;\;\frac{t}{3 \cdot \left(z \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{y}{z \cdot 3}, x\right)\\
\end{array}
\end{array}
if y < -9.99999999999999933e-125Initial program 99.7%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6480.7
Simplified80.7%
if -9.99999999999999933e-125 < y < 7.5999999999999999e-13Initial program 90.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6491.1
Applied egg-rr91.1%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6463.2
Simplified63.2%
times-fracN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt-neg-inN/A
lower-/.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-eval64.8
Applied egg-rr64.8%
lift-*.f64N/A
associate-/l/N/A
*-commutativeN/A
lift-*.f64N/A
metadata-evalN/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lower-/.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6463.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6463.2
Applied egg-rr63.2%
if 7.5999999999999999e-13 < y Initial program 96.9%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6490.8
Simplified90.8%
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-*l/N/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt-neg-inN/A
lift-*.f64N/A
neg-mul-1N/A
times-fracN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f6490.9
Applied egg-rr90.9%
Final simplification76.0%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma y (/ -0.3333333333333333 z) x))) (if (<= y -1e-124) t_1 (if (<= y 7.6e-13) (/ t (* 3.0 (* z y))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(y, (-0.3333333333333333 / z), x);
double tmp;
if (y <= -1e-124) {
tmp = t_1;
} else if (y <= 7.6e-13) {
tmp = t / (3.0 * (z * y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(y, Float64(-0.3333333333333333 / z), x) tmp = 0.0 if (y <= -1e-124) tmp = t_1; elseif (y <= 7.6e-13) tmp = Float64(t / Float64(3.0 * Float64(z * y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -1e-124], t$95$1, If[LessEqual[y, 7.6e-13], N[(t / N[(3.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{-124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-13}:\\
\;\;\;\;\frac{t}{3 \cdot \left(z \cdot y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.99999999999999933e-125 or 7.5999999999999999e-13 < y Initial program 98.5%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6485.1
Simplified85.1%
if -9.99999999999999933e-125 < y < 7.5999999999999999e-13Initial program 90.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6491.1
Applied egg-rr91.1%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6463.2
Simplified63.2%
times-fracN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
distribute-rgt-neg-inN/A
lower-/.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
metadata-eval64.8
Applied egg-rr64.8%
lift-*.f64N/A
associate-/l/N/A
*-commutativeN/A
lift-*.f64N/A
metadata-evalN/A
div-invN/A
associate-/l*N/A
lift-*.f64N/A
lower-/.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6463.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6463.2
Applied egg-rr63.2%
Final simplification75.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma y (/ -0.3333333333333333 z) x)))
(if (<= y -1e-124)
t_1
(if (<= y 7.6e-13) (* t (/ 0.3333333333333333 (* z y))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(y, (-0.3333333333333333 / z), x);
double tmp;
if (y <= -1e-124) {
tmp = t_1;
} else if (y <= 7.6e-13) {
tmp = t * (0.3333333333333333 / (z * y));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(y, Float64(-0.3333333333333333 / z), x) tmp = 0.0 if (y <= -1e-124) tmp = t_1; elseif (y <= 7.6e-13) tmp = Float64(t * Float64(0.3333333333333333 / Float64(z * y))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -1e-124], t$95$1, If[LessEqual[y, 7.6e-13], N[(t * N[(0.3333333333333333 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{-124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{-13}:\\
\;\;\;\;t \cdot \frac{0.3333333333333333}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.99999999999999933e-125 or 7.5999999999999999e-13 < y Initial program 98.5%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6485.1
Simplified85.1%
if -9.99999999999999933e-125 < y < 7.5999999999999999e-13Initial program 90.2%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6491.1
Applied egg-rr91.1%
Taylor expanded in y around 0
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6463.2
Simplified63.2%
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6463.1
Applied egg-rr63.1%
Final simplification75.9%
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ t y) y) (* z 3.0))))
double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.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 = x + (((t / y) - y) / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
def code(x, y, z, t): return x + (((t / y) - y) / (z * 3.0))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))) end
function tmp = code(x, y, z, t) tmp = x + (((t / y) - y) / (z * 3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{t}{y} - y}{z \cdot 3}
\end{array}
Initial program 95.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.4
Applied egg-rr95.4%
Final simplification95.4%
(FPCore (x y z t) :precision binary64 (fma (/ 0.3333333333333333 z) (- (/ t y) y) x))
double code(double x, double y, double z, double t) {
return fma((0.3333333333333333 / z), ((t / y) - y), x);
}
function code(x, y, z, t) return fma(Float64(0.3333333333333333 / z), Float64(Float64(t / y) - y), x) end
code[x_, y_, z_, t_] := N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{0.3333333333333333}{z}, \frac{t}{y} - y, x\right)
\end{array}
Initial program 95.1%
Taylor expanded in y around inf
Simplified95.4%
(FPCore (x y z t) :precision binary64 (if (<= y -9e-8) (/ (* y -0.3333333333333333) z) (if (<= y 7.5e+42) (+ x (/ -0.3333333333333333 z)) (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-8) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 7.5e+42) {
tmp = x + (-0.3333333333333333 / z);
} else {
tmp = y / (z * -3.0);
}
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 <= (-9d-8)) then
tmp = (y * (-0.3333333333333333d0)) / z
else if (y <= 7.5d+42) then
tmp = x + ((-0.3333333333333333d0) / z)
else
tmp = y / (z * (-3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9e-8) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 7.5e+42) {
tmp = x + (-0.3333333333333333 / z);
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9e-8: tmp = (y * -0.3333333333333333) / z elif y <= 7.5e+42: tmp = x + (-0.3333333333333333 / z) else: tmp = y / (z * -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9e-8) tmp = Float64(Float64(y * -0.3333333333333333) / z); elseif (y <= 7.5e+42) tmp = Float64(x + Float64(-0.3333333333333333 / z)); else tmp = Float64(y / Float64(z * -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9e-8) tmp = (y * -0.3333333333333333) / z; elseif (y <= 7.5e+42) tmp = x + (-0.3333333333333333 / z); else tmp = y / (z * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9e-8], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 7.5e+42], N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-8}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -8.99999999999999986e-8Initial program 99.7%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6476.9
Simplified76.9%
if -8.99999999999999986e-8 < y < 7.50000000000000041e42Initial program 92.2%
Taylor expanded in t around 0
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6435.2
Simplified35.2%
if 7.50000000000000041e42 < y Initial program 98.0%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.6
Simplified82.6%
associate-/l*N/A
clear-numN/A
div-invN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.7
Applied egg-rr82.7%
Final simplification54.1%
(FPCore (x y z t) :precision binary64 (if (<= y -1e-7) (* y (/ -0.3333333333333333 z)) (if (<= y 7.5e+42) (+ x (/ -0.3333333333333333 z)) (/ y (* z -3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1e-7) {
tmp = y * (-0.3333333333333333 / z);
} else if (y <= 7.5e+42) {
tmp = x + (-0.3333333333333333 / z);
} else {
tmp = y / (z * -3.0);
}
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 <= (-1d-7)) then
tmp = y * ((-0.3333333333333333d0) / z)
else if (y <= 7.5d+42) then
tmp = x + ((-0.3333333333333333d0) / z)
else
tmp = y / (z * (-3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1e-7) {
tmp = y * (-0.3333333333333333 / z);
} else if (y <= 7.5e+42) {
tmp = x + (-0.3333333333333333 / z);
} else {
tmp = y / (z * -3.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1e-7: tmp = y * (-0.3333333333333333 / z) elif y <= 7.5e+42: tmp = x + (-0.3333333333333333 / z) else: tmp = y / (z * -3.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1e-7) tmp = Float64(y * Float64(-0.3333333333333333 / z)); elseif (y <= 7.5e+42) tmp = Float64(x + Float64(-0.3333333333333333 / z)); else tmp = Float64(y / Float64(z * -3.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1e-7) tmp = y * (-0.3333333333333333 / z); elseif (y <= 7.5e+42) tmp = x + (-0.3333333333333333 / z); else tmp = y / (z * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1e-7], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5e+42], N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-7}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\end{array}
\end{array}
if y < -9.9999999999999995e-8Initial program 99.7%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6476.9
Simplified76.9%
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
metadata-evalN/A
div-invN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
div-invN/A
clear-numN/A
lift-/.f6476.9
Applied egg-rr76.9%
if -9.9999999999999995e-8 < y < 7.50000000000000041e42Initial program 92.2%
Taylor expanded in t around 0
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6435.2
Simplified35.2%
if 7.50000000000000041e42 < y Initial program 98.0%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.6
Simplified82.6%
associate-/l*N/A
clear-numN/A
div-invN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6482.7
Applied egg-rr82.7%
Final simplification54.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* y (/ -0.3333333333333333 z))))
(if (<= y -1e-7)
t_1
(if (<= y 7.5e+42) (+ x (/ -0.3333333333333333 z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * (-0.3333333333333333 / z);
double tmp;
if (y <= -1e-7) {
tmp = t_1;
} else if (y <= 7.5e+42) {
tmp = x + (-0.3333333333333333 / z);
} 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 * ((-0.3333333333333333d0) / z)
if (y <= (-1d-7)) then
tmp = t_1
else if (y <= 7.5d+42) then
tmp = x + ((-0.3333333333333333d0) / z)
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 * (-0.3333333333333333 / z);
double tmp;
if (y <= -1e-7) {
tmp = t_1;
} else if (y <= 7.5e+42) {
tmp = x + (-0.3333333333333333 / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (-0.3333333333333333 / z) tmp = 0 if y <= -1e-7: tmp = t_1 elif y <= 7.5e+42: tmp = x + (-0.3333333333333333 / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(-0.3333333333333333 / z)) tmp = 0.0 if (y <= -1e-7) tmp = t_1; elseif (y <= 7.5e+42) tmp = Float64(x + Float64(-0.3333333333333333 / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (-0.3333333333333333 / z); tmp = 0.0; if (y <= -1e-7) tmp = t_1; elseif (y <= 7.5e+42) tmp = x + (-0.3333333333333333 / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e-7], t$95$1, If[LessEqual[y, 7.5e+42], N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{if}\;y \leq -1 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.9999999999999995e-8 or 7.50000000000000041e42 < y Initial program 98.9%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6479.6
Simplified79.6%
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
metadata-evalN/A
div-invN/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
div-invN/A
clear-numN/A
lift-/.f6479.6
Applied egg-rr79.6%
if -9.9999999999999995e-8 < y < 7.50000000000000041e42Initial program 92.2%
Taylor expanded in t around 0
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6435.2
Simplified35.2%
Final simplification54.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* -0.3333333333333333 (/ y z))))
(if (<= y -1e-7)
t_1
(if (<= y 7.5e+42) (+ x (/ -0.3333333333333333 z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = -0.3333333333333333 * (y / z);
double tmp;
if (y <= -1e-7) {
tmp = t_1;
} else if (y <= 7.5e+42) {
tmp = x + (-0.3333333333333333 / z);
} 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.3333333333333333d0) * (y / z)
if (y <= (-1d-7)) then
tmp = t_1
else if (y <= 7.5d+42) then
tmp = x + ((-0.3333333333333333d0) / z)
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.3333333333333333 * (y / z);
double tmp;
if (y <= -1e-7) {
tmp = t_1;
} else if (y <= 7.5e+42) {
tmp = x + (-0.3333333333333333 / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -0.3333333333333333 * (y / z) tmp = 0 if y <= -1e-7: tmp = t_1 elif y <= 7.5e+42: tmp = x + (-0.3333333333333333 / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-0.3333333333333333 * Float64(y / z)) tmp = 0.0 if (y <= -1e-7) tmp = t_1; elseif (y <= 7.5e+42) tmp = Float64(x + Float64(-0.3333333333333333 / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -0.3333333333333333 * (y / z); tmp = 0.0; if (y <= -1e-7) tmp = t_1; elseif (y <= 7.5e+42) tmp = x + (-0.3333333333333333 / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e-7], t$95$1, If[LessEqual[y, 7.5e+42], N[(x + N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -1 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+42}:\\
\;\;\;\;x + \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.9999999999999995e-8 or 7.50000000000000041e42 < y Initial program 98.9%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6499.7
Applied egg-rr99.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower-/.f6479.5
Simplified79.5%
if -9.9999999999999995e-8 < y < 7.50000000000000041e42Initial program 92.2%
Taylor expanded in t around 0
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6435.2
Simplified35.2%
(FPCore (x y z t) :precision binary64 (fma y (/ -0.3333333333333333 z) x))
double code(double x, double y, double z, double t) {
return fma(y, (-0.3333333333333333 / z), x);
}
function code(x, y, z, t) return fma(y, Float64(-0.3333333333333333 / z), x) end
code[x_, y_, z_, t_] := N[(y * N[(-0.3333333333333333 / z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{-0.3333333333333333}{z}, x\right)
\end{array}
Initial program 95.1%
Taylor expanded in y around inf
sub-negN/A
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6462.1
Simplified62.1%
(FPCore (x y z t) :precision binary64 (- (/ y z)))
double code(double x, double y, double z, double t) {
return -(y / 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 = -(y / z)
end function
public static double code(double x, double y, double z, double t) {
return -(y / z);
}
def code(x, y, z, t): return -(y / z)
function code(x, y, z, t) return Float64(-Float64(y / z)) end
function tmp = code(x, y, z, t) tmp = -(y / z); end
code[x_, y_, z_, t_] := (-N[(y / z), $MachinePrecision])
\begin{array}{l}
\\
-\frac{y}{z}
\end{array}
Initial program 95.1%
Taylor expanded in y around inf
associate-*r/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6436.3
Simplified36.3%
Taylor expanded in y around -inf
mul-1-negN/A
lower-neg.f6417.4
Simplified17.4%
Final simplification17.4%
(FPCore (x y z t) :precision binary64 (/ 1.0 z))
double code(double x, double y, double z, double t) {
return 1.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 = 1.0d0 / z
end function
public static double code(double x, double y, double z, double t) {
return 1.0 / z;
}
def code(x, y, z, t): return 1.0 / z
function code(x, y, z, t) return Float64(1.0 / z) end
function tmp = code(x, y, z, t) tmp = 1.0 / z; end
code[x_, y_, z_, t_] := N[(1.0 / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{z}
\end{array}
Initial program 95.1%
Taylor expanded in t around 0
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6427.7
Simplified27.7%
Taylor expanded in x around 0
lower-/.f643.1
Simplified3.1%
Taylor expanded in z around 0
lower-/.f643.2
Simplified3.2%
(FPCore (x y z t) :precision binary64 (/ -0.3333333333333333 z))
double code(double x, double y, double z, double t) {
return -0.3333333333333333 / 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 = (-0.3333333333333333d0) / z
end function
public static double code(double x, double y, double z, double t) {
return -0.3333333333333333 / z;
}
def code(x, y, z, t): return -0.3333333333333333 / z
function code(x, y, z, t) return Float64(-0.3333333333333333 / z) end
function tmp = code(x, y, z, t) tmp = -0.3333333333333333 / z; end
code[x_, y_, z_, t_] := N[(-0.3333333333333333 / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{-0.3333333333333333}{z}
\end{array}
Initial program 95.1%
Taylor expanded in t around 0
sub-negN/A
lower-+.f64N/A
associate-*r/N/A
metadata-evalN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6427.7
Simplified27.7%
Taylor expanded in x around 0
lower-/.f643.1
Simplified3.1%
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y)))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.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 - (y / (z * 3.0d0))) + ((t / (z * 3.0d0)) / y)
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y)
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(Float64(t / Float64(z * 3.0)) / y)) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}
herbie shell --seed 2024214
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(! :herbie-platform default (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y)))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))