
(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 16 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 (+ (+ x (* -0.3333333333333333 (/ y z))) (/ (* 0.3333333333333333 (/ t z)) y)))
double code(double x, double y, double z, double t) {
return (x + (-0.3333333333333333 * (y / z))) + ((0.3333333333333333 * (t / z)) / 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 + ((-0.3333333333333333d0) * (y / z))) + ((0.3333333333333333d0 * (t / z)) / y)
end function
public static double code(double x, double y, double z, double t) {
return (x + (-0.3333333333333333 * (y / z))) + ((0.3333333333333333 * (t / z)) / y);
}
def code(x, y, z, t): return (x + (-0.3333333333333333 * (y / z))) + ((0.3333333333333333 * (t / z)) / y)
function code(x, y, z, t) return Float64(Float64(x + Float64(-0.3333333333333333 * Float64(y / z))) + Float64(Float64(0.3333333333333333 * Float64(t / z)) / y)) end
function tmp = code(x, y, z, t) tmp = (x + (-0.3333333333333333 * (y / z))) + ((0.3333333333333333 * (t / z)) / y); end
code[x_, y_, z_, t_] := N[(N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.3333333333333333 * N[(t / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + -0.3333333333333333 \cdot \frac{y}{z}\right) + \frac{0.3333333333333333 \cdot \frac{t}{z}}{y}
\end{array}
Initial program 93.9%
sub-neg93.9%
distribute-frac-neg93.9%
neg-mul-193.9%
*-commutative93.9%
times-frac93.9%
metadata-eval93.9%
associate-/l/96.1%
associate-/l/96.1%
Simplified96.1%
associate-/l/96.1%
*-un-lft-identity96.1%
times-frac96.1%
associate-/l/96.1%
times-frac93.9%
associate-*l*93.9%
*-commutative93.9%
times-frac97.9%
*-un-lft-identity97.9%
*-commutative97.9%
times-frac97.9%
metadata-eval97.9%
Applied egg-rr97.9%
associate-*l/97.9%
*-lft-identity97.9%
Simplified97.9%
Final simplification97.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -8.6e+127)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= z 1e-29)
(* -0.3333333333333333 (/ (- y (/ t y)) z))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.6e+127) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (z <= 1e-29) {
tmp = -0.3333333333333333 * ((y - (t / y)) / z);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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 <= (-8.6d+127)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (z <= 1d-29) then
tmp = (-0.3333333333333333d0) * ((y - (t / y)) / z)
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.6e+127) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (z <= 1e-29) {
tmp = -0.3333333333333333 * ((y - (t / y)) / z);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.6e+127: tmp = x + ((-0.3333333333333333 * y) / z) elif z <= 1e-29: tmp = -0.3333333333333333 * ((y - (t / y)) / z) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.6e+127) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (z <= 1e-29) tmp = Float64(-0.3333333333333333 * Float64(Float64(y - Float64(t / y)) / z)); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8.6e+127) tmp = x + ((-0.3333333333333333 * y) / z); elseif (z <= 1e-29) tmp = -0.3333333333333333 * ((y - (t / y)) / z); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.6e+127], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e-29], N[(-0.3333333333333333 * N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+127}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;z \leq 10^{-29}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if z < -8.59999999999999968e127Initial program 97.7%
Simplified91.5%
Taylor expanded in y around inf 80.9%
associate-*l/81.0%
Applied egg-rr81.0%
if -8.59999999999999968e127 < z < 9.99999999999999943e-30Initial program 89.6%
Simplified99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in x around 0 91.5%
if 9.99999999999999943e-30 < z Initial program 99.8%
Taylor expanded in t around 0 79.7%
Final simplification86.3%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.9e+127)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= z 1.02e-25)
(* -0.3333333333333333 (/ (- y (/ t y)) z))
(+ x (* -0.3333333333333333 (* y (/ 1.0 z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.9e+127) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (z <= 1.02e-25) {
tmp = -0.3333333333333333 * ((y - (t / y)) / z);
} else {
tmp = x + (-0.3333333333333333 * (y * (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 <= (-2.9d+127)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (z <= 1.02d-25) then
tmp = (-0.3333333333333333d0) * ((y - (t / y)) / z)
else
tmp = x + ((-0.3333333333333333d0) * (y * (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 <= -2.9e+127) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (z <= 1.02e-25) {
tmp = -0.3333333333333333 * ((y - (t / y)) / z);
} else {
tmp = x + (-0.3333333333333333 * (y * (1.0 / z)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.9e+127: tmp = x + ((-0.3333333333333333 * y) / z) elif z <= 1.02e-25: tmp = -0.3333333333333333 * ((y - (t / y)) / z) else: tmp = x + (-0.3333333333333333 * (y * (1.0 / z))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.9e+127) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (z <= 1.02e-25) tmp = Float64(-0.3333333333333333 * Float64(Float64(y - Float64(t / y)) / z)); else tmp = Float64(x + Float64(-0.3333333333333333 * Float64(y * Float64(1.0 / z)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.9e+127) tmp = x + ((-0.3333333333333333 * y) / z); elseif (z <= 1.02e-25) tmp = -0.3333333333333333 * ((y - (t / y)) / z); else tmp = x + (-0.3333333333333333 * (y * (1.0 / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.9e+127], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e-25], N[(-0.3333333333333333 * N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(-0.3333333333333333 * N[(y * N[(1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+127}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-25}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;x + -0.3333333333333333 \cdot \left(y \cdot \frac{1}{z}\right)\\
\end{array}
\end{array}
if z < -2.9000000000000002e127Initial program 97.7%
Simplified91.5%
Taylor expanded in y around inf 80.9%
associate-*l/81.0%
Applied egg-rr81.0%
if -2.9000000000000002e127 < z < 1.01999999999999998e-25Initial program 89.6%
Simplified99.7%
Taylor expanded in z around 0 99.6%
Taylor expanded in x around 0 91.6%
if 1.01999999999999998e-25 < z Initial program 99.8%
Simplified92.1%
Taylor expanded in z around 0 92.2%
div-inv92.1%
Applied egg-rr92.1%
Taylor expanded in y around inf 79.4%
Final simplification86.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.05e+18)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= y 1e-78)
(+ x (* 0.3333333333333333 (/ t (* y z))))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e+18) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 1e-78) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.05d+18)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (y <= 1d-78) then
tmp = x + (0.3333333333333333d0 * (t / (y * z)))
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e+18) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 1e-78) {
tmp = x + (0.3333333333333333 * (t / (y * z)));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.05e+18: tmp = x + ((-0.3333333333333333 * y) / z) elif y <= 1e-78: tmp = x + (0.3333333333333333 * (t / (y * z))) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.05e+18) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (y <= 1e-78) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.05e+18) tmp = x + ((-0.3333333333333333 * y) / z); elseif (y <= 1e-78) tmp = x + (0.3333333333333333 * (t / (y * z))); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.05e+18], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e-78], N[(x + N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 10^{-78}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -1.05e18Initial program 98.3%
Simplified99.7%
Taylor expanded in y around inf 92.0%
associate-*l/92.1%
Applied egg-rr92.1%
if -1.05e18 < y < 9.99999999999999999e-79Initial program 88.9%
Simplified92.1%
Taylor expanded in y around 0 85.4%
if 9.99999999999999999e-79 < y Initial program 98.5%
Taylor expanded in t around 0 92.8%
Final simplification89.1%
(FPCore (x y z t)
:precision binary64
(if (<= y -5.2e+17)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= y 1e-78)
(+ x (* (/ t y) (/ 0.3333333333333333 z)))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.2e+17) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 1e-78) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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 <= (-5.2d+17)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (y <= 1d-78) then
tmp = x + ((t / y) * (0.3333333333333333d0 / z))
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.2e+17) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 1e-78) {
tmp = x + ((t / y) * (0.3333333333333333 / z));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.2e+17: tmp = x + ((-0.3333333333333333 * y) / z) elif y <= 1e-78: tmp = x + ((t / y) * (0.3333333333333333 / z)) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.2e+17) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (y <= 1e-78) tmp = Float64(x + Float64(Float64(t / y) * Float64(0.3333333333333333 / z))); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.2e+17) tmp = x + ((-0.3333333333333333 * y) / z); elseif (y <= 1e-78) tmp = x + ((t / y) * (0.3333333333333333 / z)); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.2e+17], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e-78], N[(x + N[(N[(t / y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{+17}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 10^{-78}:\\
\;\;\;\;x + \frac{t}{y} \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -5.2e17Initial program 98.3%
Simplified99.7%
Taylor expanded in y around inf 92.0%
associate-*l/92.1%
Applied egg-rr92.1%
if -5.2e17 < y < 9.99999999999999999e-79Initial program 88.9%
Simplified92.1%
Taylor expanded in y around 0 85.4%
associate-/r*85.9%
associate-*r/85.9%
*-commutative85.9%
associate-*r/85.9%
Simplified85.9%
if 9.99999999999999999e-79 < y Initial program 98.5%
Taylor expanded in t around 0 92.8%
Final simplification89.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.8e-25)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= y 1e-78)
(- x (/ (* t (/ -0.3333333333333333 z)) y))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e-25) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 1e-78) {
tmp = x - ((t * (-0.3333333333333333 / z)) / y);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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 <= (-2.8d-25)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (y <= 1d-78) then
tmp = x - ((t * ((-0.3333333333333333d0) / z)) / y)
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e-25) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 1e-78) {
tmp = x - ((t * (-0.3333333333333333 / z)) / y);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.8e-25: tmp = x + ((-0.3333333333333333 * y) / z) elif y <= 1e-78: tmp = x - ((t * (-0.3333333333333333 / z)) / y) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.8e-25) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (y <= 1e-78) tmp = Float64(x - Float64(Float64(t * Float64(-0.3333333333333333 / z)) / y)); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.8e-25) tmp = x + ((-0.3333333333333333 * y) / z); elseif (y <= 1e-78) tmp = x - ((t * (-0.3333333333333333 / z)) / y); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.8e-25], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e-78], N[(x - N[(N[(t * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-25}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 10^{-78}:\\
\;\;\;\;x - \frac{t \cdot \frac{-0.3333333333333333}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -2.79999999999999988e-25Initial program 97.4%
Simplified99.8%
Taylor expanded in y around inf 90.9%
associate-*l/90.9%
Applied egg-rr90.9%
if -2.79999999999999988e-25 < y < 9.99999999999999999e-79Initial program 88.4%
Simplified91.2%
Taylor expanded in y around 0 85.4%
associate-/r*86.0%
associate-*r/86.0%
*-commutative86.0%
associate-*r/86.0%
Simplified86.0%
Applied egg-rr94.0%
if 9.99999999999999999e-79 < y Initial program 98.5%
Taylor expanded in t around 0 92.8%
Final simplification92.8%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.1e-89)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= y 2.3e-79)
(* -0.3333333333333333 (/ (- t) (* y z)))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e-89) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 2.3e-79) {
tmp = -0.3333333333333333 * (-t / (y * z));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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 <= (-2.1d-89)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (y <= 2.3d-79) then
tmp = (-0.3333333333333333d0) * (-t / (y * z))
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.1e-89) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 2.3e-79) {
tmp = -0.3333333333333333 * (-t / (y * z));
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.1e-89: tmp = x + ((-0.3333333333333333 * y) / z) elif y <= 2.3e-79: tmp = -0.3333333333333333 * (-t / (y * z)) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.1e-89) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (y <= 2.3e-79) tmp = Float64(-0.3333333333333333 * Float64(Float64(-t) / Float64(y * z))); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.1e-89) tmp = x + ((-0.3333333333333333 * y) / z); elseif (y <= 2.3e-79) tmp = -0.3333333333333333 * (-t / (y * z)); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.1e-89], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e-79], N[(-0.3333333333333333 * N[((-t) / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-89}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-79}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{-t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -2.1000000000000001e-89Initial program 95.9%
Simplified98.9%
Taylor expanded in y around inf 84.1%
associate-*l/84.1%
Applied egg-rr84.1%
if -2.1000000000000001e-89 < y < 2.30000000000000012e-79Initial program 88.0%
Simplified90.2%
Taylor expanded in z around 0 90.2%
Taylor expanded in x around 0 70.7%
Taylor expanded in y around 0 66.6%
associate-*r/66.6%
neg-mul-166.6%
Simplified66.6%
if 2.30000000000000012e-79 < y Initial program 98.5%
Taylor expanded in t around 0 92.8%
Final simplification80.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -5.1e-97)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= y 9e-80)
(* -0.3333333333333333 (/ (/ (- t) y) z))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.1e-97) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 9e-80) {
tmp = -0.3333333333333333 * ((-t / y) / z);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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 <= (-5.1d-97)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (y <= 9d-80) then
tmp = (-0.3333333333333333d0) * ((-t / y) / z)
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.1e-97) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 9e-80) {
tmp = -0.3333333333333333 * ((-t / y) / z);
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.1e-97: tmp = x + ((-0.3333333333333333 * y) / z) elif y <= 9e-80: tmp = -0.3333333333333333 * ((-t / y) / z) else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.1e-97) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (y <= 9e-80) tmp = Float64(-0.3333333333333333 * Float64(Float64(Float64(-t) / y) / z)); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.1e-97) tmp = x + ((-0.3333333333333333 * y) / z); elseif (y <= 9e-80) tmp = -0.3333333333333333 * ((-t / y) / z); else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.1e-97], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e-80], N[(-0.3333333333333333 * N[(N[((-t) / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.1 \cdot 10^{-97}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-80}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{\frac{-t}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -5.10000000000000035e-97Initial program 95.9%
Simplified98.9%
Taylor expanded in y around inf 84.1%
associate-*l/84.1%
Applied egg-rr84.1%
if -5.10000000000000035e-97 < y < 9.0000000000000006e-80Initial program 88.0%
Simplified90.2%
Taylor expanded in z around 0 90.2%
Taylor expanded in x around 0 70.7%
Taylor expanded in y around 0 69.2%
neg-mul-169.2%
distribute-neg-frac69.2%
Simplified69.2%
if 9.0000000000000006e-80 < y Initial program 98.5%
Taylor expanded in t around 0 92.8%
Final simplification81.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -4.1e-91)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= y 1.8e-79)
(/ (* -0.3333333333333333 (/ t y)) (- z))
(- x (* (/ y z) 0.3333333333333333)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.1e-91) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 1.8e-79) {
tmp = (-0.3333333333333333 * (t / y)) / -z;
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
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 <= (-4.1d-91)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (y <= 1.8d-79) then
tmp = ((-0.3333333333333333d0) * (t / y)) / -z
else
tmp = x - ((y / z) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.1e-91) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 1.8e-79) {
tmp = (-0.3333333333333333 * (t / y)) / -z;
} else {
tmp = x - ((y / z) * 0.3333333333333333);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.1e-91: tmp = x + ((-0.3333333333333333 * y) / z) elif y <= 1.8e-79: tmp = (-0.3333333333333333 * (t / y)) / -z else: tmp = x - ((y / z) * 0.3333333333333333) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.1e-91) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (y <= 1.8e-79) tmp = Float64(Float64(-0.3333333333333333 * Float64(t / y)) / Float64(-z)); else tmp = Float64(x - Float64(Float64(y / z) * 0.3333333333333333)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.1e-91) tmp = x + ((-0.3333333333333333 * y) / z); elseif (y <= 1.8e-79) tmp = (-0.3333333333333333 * (t / y)) / -z; else tmp = x - ((y / z) * 0.3333333333333333); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.1e-91], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e-79], N[(N[(-0.3333333333333333 * N[(t / y), $MachinePrecision]), $MachinePrecision] / (-z)), $MachinePrecision], N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{-91}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-79}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot \frac{t}{y}}{-z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z} \cdot 0.3333333333333333\\
\end{array}
\end{array}
if y < -4.10000000000000024e-91Initial program 95.9%
Simplified98.9%
Taylor expanded in y around inf 84.1%
associate-*l/84.1%
Applied egg-rr84.1%
if -4.10000000000000024e-91 < y < 1.8000000000000001e-79Initial program 88.0%
Simplified90.2%
Taylor expanded in z around 0 90.2%
Taylor expanded in x around 0 70.7%
Taylor expanded in y around 0 69.2%
neg-mul-169.2%
distribute-neg-frac69.2%
Simplified69.2%
frac-2neg69.2%
associate-*r/69.2%
distribute-frac-neg69.2%
remove-double-neg69.2%
Applied egg-rr69.2%
if 1.8000000000000001e-79 < y Initial program 98.5%
Taylor expanded in t around 0 92.8%
Final simplification81.5%
(FPCore (x y z t) :precision binary64 (+ x (* -0.3333333333333333 (/ (- y (/ t y)) z))))
double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 * ((y - (t / 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 = x + ((-0.3333333333333333d0) * ((y - (t / y)) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (-0.3333333333333333 * ((y - (t / y)) / z));
}
def code(x, y, z, t): return x + (-0.3333333333333333 * ((y - (t / y)) / z))
function code(x, y, z, t) return Float64(x + Float64(-0.3333333333333333 * Float64(Float64(y - Float64(t / y)) / z))) end
function tmp = code(x, y, z, t) tmp = x + (-0.3333333333333333 * ((y - (t / y)) / z)); end
code[x_, y_, z_, t_] := N[(x + N[(-0.3333333333333333 * N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + -0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}
\end{array}
Initial program 93.9%
Simplified96.1%
Taylor expanded in z around 0 96.1%
Final simplification96.1%
(FPCore (x y z t) :precision binary64 (if (<= z -0.00017) x (if (<= z 8.2e-24) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.00017) {
tmp = x;
} else if (z <= 8.2e-24) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = 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 <= (-0.00017d0)) then
tmp = x
else if (z <= 8.2d-24) then
tmp = (-0.3333333333333333d0) * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.00017) {
tmp = x;
} else if (z <= 8.2e-24) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -0.00017: tmp = x elif z <= 8.2e-24: tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -0.00017) tmp = x; elseif (z <= 8.2e-24) tmp = Float64(-0.3333333333333333 * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -0.00017) tmp = x; elseif (z <= 8.2e-24) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.00017], x, If[LessEqual[z, 8.2e-24], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00017:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-24}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.7e-4 or 8.20000000000000029e-24 < z Initial program 99.1%
Simplified93.2%
Taylor expanded in x around inf 56.2%
if -1.7e-4 < z < 8.20000000000000029e-24Initial program 87.4%
sub-neg87.4%
distribute-frac-neg87.4%
neg-mul-187.4%
*-commutative87.4%
times-frac87.4%
metadata-eval87.4%
associate-/l/99.7%
associate-/l/99.7%
Simplified99.7%
associate-/l/99.7%
*-un-lft-identity99.7%
times-frac99.7%
associate-/l/99.7%
times-frac87.4%
associate-*l*87.4%
*-commutative87.4%
times-frac96.2%
*-un-lft-identity96.2%
*-commutative96.2%
times-frac96.2%
metadata-eval96.2%
Applied egg-rr96.2%
associate-*l/96.2%
*-lft-identity96.2%
Simplified96.2%
Taylor expanded in y around inf 51.4%
Final simplification54.1%
(FPCore (x y z t) :precision binary64 (if (<= z -1.35e-6) x (if (<= z 4e-24) (* y (/ -0.3333333333333333 z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e-6) {
tmp = x;
} else if (z <= 4e-24) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = 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 <= (-1.35d-6)) then
tmp = x
else if (z <= 4d-24) then
tmp = y * ((-0.3333333333333333d0) / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.35e-6) {
tmp = x;
} else if (z <= 4e-24) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.35e-6: tmp = x elif z <= 4e-24: tmp = y * (-0.3333333333333333 / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.35e-6) tmp = x; elseif (z <= 4e-24) tmp = Float64(y * Float64(-0.3333333333333333 / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.35e-6) tmp = x; elseif (z <= 4e-24) tmp = y * (-0.3333333333333333 / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.35e-6], x, If[LessEqual[z, 4e-24], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-24}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.34999999999999999e-6 or 3.99999999999999969e-24 < z Initial program 99.1%
Simplified93.2%
Taylor expanded in x around inf 56.2%
if -1.34999999999999999e-6 < z < 3.99999999999999969e-24Initial program 87.4%
sub-neg87.4%
distribute-frac-neg87.4%
neg-mul-187.4%
*-commutative87.4%
times-frac87.4%
metadata-eval87.4%
associate-/l/99.7%
associate-/l/99.7%
Simplified99.7%
associate-/l/99.7%
*-un-lft-identity99.7%
times-frac99.7%
associate-/l/99.7%
times-frac87.4%
associate-*l*87.4%
*-commutative87.4%
times-frac96.2%
*-un-lft-identity96.2%
*-commutative96.2%
times-frac96.2%
metadata-eval96.2%
Applied egg-rr96.2%
associate-*l/96.2%
*-lft-identity96.2%
Simplified96.2%
Taylor expanded in y around inf 51.4%
associate-*r/51.4%
*-commutative51.4%
associate-*r/51.4%
Simplified51.4%
Final simplification54.1%
(FPCore (x y z t) :precision binary64 (if (<= z -0.00017) x (if (<= z 2.7e-24) (/ y (* z -3.0)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.00017) {
tmp = x;
} else if (z <= 2.7e-24) {
tmp = y / (z * -3.0);
} else {
tmp = 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 <= (-0.00017d0)) then
tmp = x
else if (z <= 2.7d-24) then
tmp = y / (z * (-3.0d0))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -0.00017) {
tmp = x;
} else if (z <= 2.7e-24) {
tmp = y / (z * -3.0);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -0.00017: tmp = x elif z <= 2.7e-24: tmp = y / (z * -3.0) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -0.00017) tmp = x; elseif (z <= 2.7e-24) tmp = Float64(y / Float64(z * -3.0)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -0.00017) tmp = x; elseif (z <= 2.7e-24) tmp = y / (z * -3.0); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -0.00017], x, If[LessEqual[z, 2.7e-24], N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00017:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-24}:\\
\;\;\;\;\frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.7e-4 or 2.70000000000000007e-24 < z Initial program 99.1%
Simplified93.2%
Taylor expanded in x around inf 56.2%
if -1.7e-4 < z < 2.70000000000000007e-24Initial program 87.4%
sub-neg87.4%
distribute-frac-neg87.4%
neg-mul-187.4%
*-commutative87.4%
times-frac87.4%
metadata-eval87.4%
associate-/l/99.7%
associate-/l/99.7%
Simplified99.7%
associate-/l/99.7%
*-un-lft-identity99.7%
times-frac99.7%
associate-/l/99.7%
times-frac87.4%
associate-*l*87.4%
*-commutative87.4%
times-frac96.2%
*-un-lft-identity96.2%
*-commutative96.2%
times-frac96.2%
metadata-eval96.2%
Applied egg-rr96.2%
associate-*l/96.2%
*-lft-identity96.2%
Simplified96.2%
Taylor expanded in y around inf 51.4%
associate-*r/51.4%
*-commutative51.4%
associate-*r/51.4%
Simplified51.4%
associate-*r/51.4%
associate-/l*51.4%
div-inv51.5%
metadata-eval51.5%
Applied egg-rr51.5%
Final simplification54.1%
(FPCore (x y z t) :precision binary64 (+ x (* y (/ -0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + (y * (-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 = x + (y * ((-0.3333333333333333d0) / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (y * (-0.3333333333333333 / z));
}
def code(x, y, z, t): return x + (y * (-0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(y * Float64(-0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + (y * (-0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{-0.3333333333333333}{z}
\end{array}
Initial program 93.9%
Simplified96.1%
Taylor expanded in y around inf 65.9%
Final simplification65.9%
(FPCore (x y z t) :precision binary64 (- x (* (/ y z) 0.3333333333333333)))
double code(double x, double y, double z, double t) {
return x - ((y / z) * 0.3333333333333333);
}
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) * 0.3333333333333333d0)
end function
public static double code(double x, double y, double z, double t) {
return x - ((y / z) * 0.3333333333333333);
}
def code(x, y, z, t): return x - ((y / z) * 0.3333333333333333)
function code(x, y, z, t) return Float64(x - Float64(Float64(y / z) * 0.3333333333333333)) end
function tmp = code(x, y, z, t) tmp = x - ((y / z) * 0.3333333333333333); end
code[x_, y_, z_, t_] := N[(x - N[(N[(y / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y}{z} \cdot 0.3333333333333333
\end{array}
Initial program 93.9%
Taylor expanded in t around 0 65.9%
Final simplification65.9%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.9%
Simplified96.1%
Taylor expanded in x around inf 33.8%
Final simplification33.8%
(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 2023285
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))