
(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 18 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
(let* ((t_1 (- y (/ t y))))
(if (<= y -2.6e-147)
(+ x (/ (* -0.3333333333333333 t_1) z))
(if (<= y 8e-106)
(+ x (/ (/ t (* z 3.0)) y))
(+ x (* t_1 (/ -0.3333333333333333 z)))))))
double code(double x, double y, double z, double t) {
double t_1 = y - (t / y);
double tmp;
if (y <= -2.6e-147) {
tmp = x + ((-0.3333333333333333 * t_1) / z);
} else if (y <= 8e-106) {
tmp = x + ((t / (z * 3.0)) / y);
} else {
tmp = x + (t_1 * (-0.3333333333333333 / 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) :: t_1
real(8) :: tmp
t_1 = y - (t / y)
if (y <= (-2.6d-147)) then
tmp = x + (((-0.3333333333333333d0) * t_1) / z)
else if (y <= 8d-106) then
tmp = x + ((t / (z * 3.0d0)) / y)
else
tmp = x + (t_1 * ((-0.3333333333333333d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y - (t / y);
double tmp;
if (y <= -2.6e-147) {
tmp = x + ((-0.3333333333333333 * t_1) / z);
} else if (y <= 8e-106) {
tmp = x + ((t / (z * 3.0)) / y);
} else {
tmp = x + (t_1 * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): t_1 = y - (t / y) tmp = 0 if y <= -2.6e-147: tmp = x + ((-0.3333333333333333 * t_1) / z) elif y <= 8e-106: tmp = x + ((t / (z * 3.0)) / y) else: tmp = x + (t_1 * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) t_1 = Float64(y - Float64(t / y)) tmp = 0.0 if (y <= -2.6e-147) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * t_1) / z)); elseif (y <= 8e-106) tmp = Float64(x + Float64(Float64(t / Float64(z * 3.0)) / y)); else tmp = Float64(x + Float64(t_1 * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y - (t / y); tmp = 0.0; if (y <= -2.6e-147) tmp = x + ((-0.3333333333333333 * t_1) / z); elseif (y <= 8e-106) tmp = x + ((t / (z * 3.0)) / y); else tmp = x + (t_1 * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.6e-147], N[(x + N[(N[(-0.3333333333333333 * t$95$1), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e-106], N[(x + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$1 * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \frac{t}{y}\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{-147}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot t_1}{z}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-106}:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot 3}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + t_1 \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -2.5999999999999999e-147Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
distribute-neg-in99.7%
unsub-neg99.7%
neg-mul-199.7%
associate-*r/99.7%
associate-*l/99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac98.7%
distribute-lft-out--98.7%
*-commutative98.7%
associate-/r*98.7%
metadata-eval98.7%
Simplified98.7%
associate-*l/98.8%
Applied egg-rr98.8%
if -2.5999999999999999e-147 < y < 7.99999999999999953e-106Initial program 94.0%
associate-+l-94.0%
sub-neg94.0%
sub-neg94.0%
distribute-neg-in94.0%
unsub-neg94.0%
neg-mul-194.0%
associate-*r/94.0%
associate-*l/94.0%
distribute-neg-frac94.0%
neg-mul-194.0%
times-frac87.0%
distribute-lft-out--87.0%
*-commutative87.0%
associate-/r*87.0%
metadata-eval87.0%
Simplified87.0%
Taylor expanded in y around 0 93.9%
metadata-eval93.9%
associate-/r*87.0%
times-frac87.1%
*-commutative87.1%
associate-*l/87.0%
associate-*r/97.7%
*-commutative97.7%
associate-*r/97.8%
*-rgt-identity97.8%
Simplified97.8%
if 7.99999999999999953e-106 < y Initial program 98.6%
associate-+l-98.6%
sub-neg98.6%
sub-neg98.6%
distribute-neg-in98.6%
unsub-neg98.6%
neg-mul-198.6%
associate-*r/98.6%
associate-*l/98.6%
distribute-neg-frac98.6%
neg-mul-198.6%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (+ x (fma -0.3333333333333333 (/ y z) (/ (/ (/ t z) y) 3.0))))
double code(double x, double y, double z, double t) {
return x + fma(-0.3333333333333333, (y / z), (((t / z) / y) / 3.0));
}
function code(x, y, z, t) return Float64(x + fma(-0.3333333333333333, Float64(y / z), Float64(Float64(Float64(t / z) / y) / 3.0))) end
code[x_, y_, z_, t_] := N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + N[(N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, \frac{\frac{\frac{t}{z}}{y}}{3}\right)
\end{array}
Initial program 97.5%
associate-+l-97.5%
sub-neg97.5%
sub-neg97.5%
distribute-neg-in97.5%
distribute-neg-frac97.5%
neg-mul-197.5%
*-commutative97.5%
times-frac97.6%
remove-double-neg97.6%
fma-def97.6%
metadata-eval97.6%
associate-*l*97.6%
associate-/r*98.0%
associate-/l/98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(if (<= (* z 3.0) -5e-6)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= (* z 3.0) 1e+106)
(* -0.3333333333333333 (/ (- y (/ t y)) z))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -5e-6) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if ((z * 3.0) <= 1e+106) {
tmp = -0.3333333333333333 * ((y - (t / y)) / z);
} else {
tmp = x + (y * (-0.3333333333333333 / 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) <= (-5d-6)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if ((z * 3.0d0) <= 1d+106) then
tmp = (-0.3333333333333333d0) * ((y - (t / y)) / z)
else
tmp = x + (y * ((-0.3333333333333333d0) / 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) <= -5e-6) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if ((z * 3.0) <= 1e+106) {
tmp = -0.3333333333333333 * ((y - (t / y)) / z);
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -5e-6: tmp = x + ((-0.3333333333333333 * y) / z) elif (z * 3.0) <= 1e+106: tmp = -0.3333333333333333 * ((y - (t / y)) / z) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -5e-6) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (Float64(z * 3.0) <= 1e+106) tmp = Float64(-0.3333333333333333 * Float64(Float64(y - Float64(t / y)) / z)); else tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -5e-6) tmp = x + ((-0.3333333333333333 * y) / z); elseif ((z * 3.0) <= 1e+106) tmp = -0.3333333333333333 * ((y - (t / y)) / z); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -5e-6], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * 3.0), $MachinePrecision], 1e+106], N[(-0.3333333333333333 * N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -5 \cdot 10^{-6}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;z \cdot 3 \leq 10^{+106}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y - \frac{t}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if (*.f64 z 3) < -5.00000000000000041e-6Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
unsub-neg99.8%
neg-mul-199.8%
associate-*r/99.8%
associate-*l/99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
times-frac91.3%
distribute-lft-out--91.3%
*-commutative91.3%
associate-/r*91.4%
metadata-eval91.4%
Simplified91.4%
Taylor expanded in y around inf 69.2%
associate-*l/69.3%
Applied egg-rr69.3%
if -5.00000000000000041e-6 < (*.f64 z 3) < 1.00000000000000009e106Initial program 95.9%
associate-+l-95.9%
sub-neg95.9%
sub-neg95.9%
distribute-neg-in95.9%
unsub-neg95.9%
neg-mul-195.9%
associate-*r/95.9%
associate-*l/95.9%
distribute-neg-frac95.9%
neg-mul-195.9%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.8%
Taylor expanded in z around 0 88.6%
if 1.00000000000000009e106 < (*.f64 z 3) Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
sub-neg99.6%
distribute-neg-in99.6%
unsub-neg99.6%
neg-mul-199.6%
associate-*r/99.6%
associate-*l/99.8%
distribute-neg-frac99.8%
neg-mul-199.8%
times-frac86.8%
distribute-lft-out--86.8%
*-commutative86.8%
associate-/r*87.0%
metadata-eval87.0%
Simplified87.0%
Taylor expanded in y around inf 82.6%
Final simplification82.6%
(FPCore (x y z t) :precision binary64 (+ (/ (/ t (* z 3.0)) y) (+ x (* (/ y 3.0) (/ -1.0 z)))))
double code(double x, double y, double z, double t) {
return ((t / (z * 3.0)) / y) + (x + ((y / 3.0) * (-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 = ((t / (z * 3.0d0)) / y) + (x + ((y / 3.0d0) * ((-1.0d0) / z)))
end function
public static double code(double x, double y, double z, double t) {
return ((t / (z * 3.0)) / y) + (x + ((y / 3.0) * (-1.0 / z)));
}
def code(x, y, z, t): return ((t / (z * 3.0)) / y) + (x + ((y / 3.0) * (-1.0 / z)))
function code(x, y, z, t) return Float64(Float64(Float64(t / Float64(z * 3.0)) / y) + Float64(x + Float64(Float64(y / 3.0) * Float64(-1.0 / z)))) end
function tmp = code(x, y, z, t) tmp = ((t / (z * 3.0)) / y) + (x + ((y / 3.0) * (-1.0 / z))); end
code[x_, y_, z_, t_] := N[(N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] + N[(x + N[(N[(y / 3.0), $MachinePrecision] * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t}{z \cdot 3}}{y} + \left(x + \frac{y}{3} \cdot \frac{-1}{z}\right)
\end{array}
Initial program 97.5%
associate-/r*98.0%
Simplified98.0%
*-un-lft-identity98.0%
times-frac98.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t) :precision binary64 (+ (+ x (/ -1.0 (* 3.0 (/ z y)))) (/ (/ t (* z 3.0)) y)))
double code(double x, double y, double z, double t) {
return (x + (-1.0 / (3.0 * (z / y)))) + ((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 + ((-1.0d0) / (3.0d0 * (z / y)))) + ((t / (z * 3.0d0)) / y)
end function
public static double code(double x, double y, double z, double t) {
return (x + (-1.0 / (3.0 * (z / y)))) + ((t / (z * 3.0)) / y);
}
def code(x, y, z, t): return (x + (-1.0 / (3.0 * (z / y)))) + ((t / (z * 3.0)) / y)
function code(x, y, z, t) return Float64(Float64(x + Float64(-1.0 / Float64(3.0 * Float64(z / y)))) + Float64(Float64(t / Float64(z * 3.0)) / y)) end
function tmp = code(x, y, z, t) tmp = (x + (-1.0 / (3.0 * (z / y)))) + ((t / (z * 3.0)) / y); end
code[x_, y_, z_, t_] := N[(N[(x + N[(-1.0 / N[(3.0 * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \frac{-1}{3 \cdot \frac{z}{y}}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}
Initial program 97.5%
associate-/r*98.0%
Simplified98.0%
clear-num97.9%
inv-pow97.9%
*-commutative97.9%
*-un-lft-identity97.9%
times-frac98.0%
metadata-eval98.0%
Applied egg-rr98.0%
unpow-198.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1e-149) (not (<= y 1.75e-108))) (+ x (* (- y (/ t y)) (/ -0.3333333333333333 z))) (+ x (/ (/ t (* z 3.0)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e-149) || !(y <= 1.75e-108)) {
tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z));
} else {
tmp = x + ((t / (z * 3.0)) / y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1d-149)) .or. (.not. (y <= 1.75d-108))) then
tmp = x + ((y - (t / y)) * ((-0.3333333333333333d0) / z))
else
tmp = x + ((t / (z * 3.0d0)) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1e-149) || !(y <= 1.75e-108)) {
tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z));
} else {
tmp = x + ((t / (z * 3.0)) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1e-149) or not (y <= 1.75e-108): tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z)) else: tmp = x + ((t / (z * 3.0)) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1e-149) || !(y <= 1.75e-108)) tmp = Float64(x + Float64(Float64(y - Float64(t / y)) * Float64(-0.3333333333333333 / z))); else tmp = Float64(x + Float64(Float64(t / Float64(z * 3.0)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1e-149) || ~((y <= 1.75e-108))) tmp = x + ((y - (t / y)) * (-0.3333333333333333 / z)); else tmp = x + ((t / (z * 3.0)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1e-149], N[Not[LessEqual[y, 1.75e-108]], $MachinePrecision]], N[(x + N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{-149} \lor \neg \left(y \leq 1.75 \cdot 10^{-108}\right):\\
\;\;\;\;x + \left(y - \frac{t}{y}\right) \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot 3}}{y}\\
\end{array}
\end{array}
if y < -9.99999999999999979e-150 or 1.7499999999999999e-108 < y Initial program 99.2%
associate-+l-99.2%
sub-neg99.2%
sub-neg99.2%
distribute-neg-in99.2%
unsub-neg99.2%
neg-mul-199.2%
associate-*r/99.2%
associate-*l/99.2%
distribute-neg-frac99.2%
neg-mul-199.2%
times-frac99.1%
distribute-lft-out--99.1%
*-commutative99.1%
associate-/r*99.2%
metadata-eval99.2%
Simplified99.2%
if -9.99999999999999979e-150 < y < 1.7499999999999999e-108Initial program 94.0%
associate-+l-94.0%
sub-neg94.0%
sub-neg94.0%
distribute-neg-in94.0%
unsub-neg94.0%
neg-mul-194.0%
associate-*r/94.0%
associate-*l/94.0%
distribute-neg-frac94.0%
neg-mul-194.0%
times-frac87.0%
distribute-lft-out--87.0%
*-commutative87.0%
associate-/r*87.0%
metadata-eval87.0%
Simplified87.0%
Taylor expanded in y around 0 93.9%
metadata-eval93.9%
associate-/r*87.0%
times-frac87.1%
*-commutative87.1%
associate-*l/87.0%
associate-*r/97.7%
*-commutative97.7%
associate-*r/97.8%
*-rgt-identity97.8%
Simplified97.8%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* z (* y 3.0)))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / (z * (y * 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 - (y / (z * 3.0d0))) + (t / (z * (y * 3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / (z * (y * 3.0)));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / (z * (y * 3.0)))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(z * Float64(y * 3.0)))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / (z * (y * 3.0))); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}
\end{array}
Initial program 97.5%
Taylor expanded in z around 0 97.5%
associate-*r*97.5%
*-commutative97.5%
*-commutative97.5%
Simplified97.5%
Final simplification97.5%
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* y (* z 3.0)))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / (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 - (y / (z * 3.0d0))) + (t / (y * (z * 3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / (y * (z * 3.0)))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(y * Float64(z * 3.0)))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / (y * (z * 3.0))); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{y \cdot \left(z \cdot 3\right)}
\end{array}
Initial program 97.5%
Final simplification97.5%
(FPCore (x y z t) :precision binary64 (+ (/ (/ t (* z 3.0)) y) (- x (/ y (* z 3.0)))))
double code(double x, double y, double z, double t) {
return ((t / (z * 3.0)) / y) + (x - (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 = ((t / (z * 3.0d0)) / y) + (x - (y / (z * 3.0d0)))
end function
public static double code(double x, double y, double z, double t) {
return ((t / (z * 3.0)) / y) + (x - (y / (z * 3.0)));
}
def code(x, y, z, t): return ((t / (z * 3.0)) / y) + (x - (y / (z * 3.0)))
function code(x, y, z, t) return Float64(Float64(Float64(t / Float64(z * 3.0)) / y) + Float64(x - Float64(y / Float64(z * 3.0)))) end
function tmp = code(x, y, z, t) tmp = ((t / (z * 3.0)) / y) + (x - (y / (z * 3.0))); end
code[x_, y_, z_, t_] := N[(N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] + N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{t}{z \cdot 3}}{y} + \left(x - \frac{y}{z \cdot 3}\right)
\end{array}
Initial program 97.5%
associate-/r*98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* -0.3333333333333333 y) z)))
(if (<= y -1.1e+69)
t_1
(if (<= y -1100000000000.0)
x
(if (<= y 3.6e+28) (* 0.3333333333333333 (/ t (* y z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (-0.3333333333333333 * y) / z;
double tmp;
if (y <= -1.1e+69) {
tmp = t_1;
} else if (y <= -1100000000000.0) {
tmp = x;
} else if (y <= 3.6e+28) {
tmp = 0.3333333333333333 * (t / (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 = ((-0.3333333333333333d0) * y) / z
if (y <= (-1.1d+69)) then
tmp = t_1
else if (y <= (-1100000000000.0d0)) then
tmp = x
else if (y <= 3.6d+28) then
tmp = 0.3333333333333333d0 * (t / (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 = (-0.3333333333333333 * y) / z;
double tmp;
if (y <= -1.1e+69) {
tmp = t_1;
} else if (y <= -1100000000000.0) {
tmp = x;
} else if (y <= 3.6e+28) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (-0.3333333333333333 * y) / z tmp = 0 if y <= -1.1e+69: tmp = t_1 elif y <= -1100000000000.0: tmp = x elif y <= 3.6e+28: tmp = 0.3333333333333333 * (t / (y * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-0.3333333333333333 * y) / z) tmp = 0.0 if (y <= -1.1e+69) tmp = t_1; elseif (y <= -1100000000000.0) tmp = x; elseif (y <= 3.6e+28) tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * 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 <= -1.1e+69) tmp = t_1; elseif (y <= -1100000000000.0) tmp = x; elseif (y <= 3.6e+28) tmp = 0.3333333333333333 * (t / (y * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -1.1e+69], t$95$1, If[LessEqual[y, -1100000000000.0], x, If[LessEqual[y, 3.6e+28], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{+69}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1100000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+28}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -1.1000000000000001e69 or 3.5999999999999999e28 < y Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
distribute-neg-in99.7%
unsub-neg99.7%
neg-mul-199.7%
associate-*r/99.7%
associate-*l/99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
times-frac99.6%
distribute-lft-out--99.6%
*-commutative99.6%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 76.1%
Taylor expanded in y around inf 74.3%
associate-*r/74.3%
Applied egg-rr74.3%
if -1.1000000000000001e69 < y < -1.1e12Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
sub-neg99.8%
distribute-neg-in99.8%
unsub-neg99.8%
neg-mul-199.8%
associate-*r/99.8%
associate-*l/99.9%
distribute-neg-frac99.9%
neg-mul-199.9%
times-frac100.0%
distribute-lft-out--100.0%
*-commutative100.0%
associate-/r*99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 65.3%
if -1.1e12 < y < 3.5999999999999999e28Initial program 95.7%
associate-+l-95.7%
sub-neg95.7%
sub-neg95.7%
distribute-neg-in95.7%
unsub-neg95.7%
neg-mul-195.7%
associate-*r/95.7%
associate-*l/95.7%
distribute-neg-frac95.7%
neg-mul-195.7%
times-frac91.6%
distribute-lft-out--91.6%
*-commutative91.6%
associate-/r*91.6%
metadata-eval91.6%
Simplified91.6%
Taylor expanded in y around 0 91.6%
metadata-eval91.6%
associate-/r*87.5%
times-frac87.5%
*-commutative87.5%
associate-*l/87.5%
associate-*r/94.0%
*-commutative94.0%
associate-*r/94.1%
*-rgt-identity94.1%
Simplified94.1%
Taylor expanded in x around 0 63.2%
Final simplification67.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.8e+19)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= y 2.8e+28)
(+ x (/ (/ t (* z 3.0)) y))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.8e+19) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 2.8e+28) {
tmp = x + ((t / (z * 3.0)) / y);
} else {
tmp = x + (y * (-0.3333333333333333 / 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 (y <= (-3.8d+19)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (y <= 2.8d+28) then
tmp = x + ((t / (z * 3.0d0)) / y)
else
tmp = x + (y * ((-0.3333333333333333d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.8e+19) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 2.8e+28) {
tmp = x + ((t / (z * 3.0)) / y);
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.8e+19: tmp = x + ((-0.3333333333333333 * y) / z) elif y <= 2.8e+28: tmp = x + ((t / (z * 3.0)) / y) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.8e+19) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (y <= 2.8e+28) tmp = Float64(x + Float64(Float64(t / Float64(z * 3.0)) / y)); else tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.8e+19) tmp = x + ((-0.3333333333333333 * y) / z); elseif (y <= 2.8e+28) tmp = x + ((t / (z * 3.0)) / y); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.8e+19], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+28], N[(x + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{+19}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+28}:\\
\;\;\;\;x + \frac{\frac{t}{z \cdot 3}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -3.8e19Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
distribute-neg-in99.7%
unsub-neg99.7%
neg-mul-199.7%
associate-*r/99.7%
associate-*l/99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac99.7%
distribute-lft-out--99.7%
*-commutative99.7%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 95.2%
associate-*l/95.3%
Applied egg-rr95.3%
if -3.8e19 < y < 2.8000000000000001e28Initial program 95.7%
associate-+l-95.7%
sub-neg95.7%
sub-neg95.7%
distribute-neg-in95.7%
unsub-neg95.7%
neg-mul-195.7%
associate-*r/95.7%
associate-*l/95.8%
distribute-neg-frac95.8%
neg-mul-195.8%
times-frac91.7%
distribute-lft-out--91.7%
*-commutative91.7%
associate-/r*91.7%
metadata-eval91.7%
Simplified91.7%
Taylor expanded in y around 0 91.6%
metadata-eval91.6%
associate-/r*87.6%
times-frac87.6%
*-commutative87.6%
associate-*l/87.6%
associate-*r/94.1%
*-commutative94.1%
associate-*r/94.1%
*-rgt-identity94.1%
Simplified94.1%
if 2.8000000000000001e28 < y Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
distribute-neg-in99.7%
unsub-neg99.7%
neg-mul-199.7%
associate-*r/99.7%
associate-*l/99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
times-frac99.6%
distribute-lft-out--99.6%
*-commutative99.6%
associate-/r*99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 99.7%
Final simplification95.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.6e-53) (not (<= y 2.9e-148))) (+ x (* y (/ -0.3333333333333333 z))) (* 0.3333333333333333 (/ t (* y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.6e-53) || !(y <= 2.9e-148)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = 0.3333333333333333 * (t / (y * 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 ((y <= (-5.6d-53)) .or. (.not. (y <= 2.9d-148))) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else
tmp = 0.3333333333333333d0 * (t / (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.6e-53) || !(y <= 2.9e-148)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = 0.3333333333333333 * (t / (y * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.6e-53) or not (y <= 2.9e-148): tmp = x + (y * (-0.3333333333333333 / z)) else: tmp = 0.3333333333333333 * (t / (y * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.6e-53) || !(y <= 2.9e-148)) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); else tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.6e-53) || ~((y <= 2.9e-148))) tmp = x + (y * (-0.3333333333333333 / z)); else tmp = 0.3333333333333333 * (t / (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.6e-53], N[Not[LessEqual[y, 2.9e-148]], $MachinePrecision]], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{-53} \lor \neg \left(y \leq 2.9 \cdot 10^{-148}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\end{array}
\end{array}
if y < -5.59999999999999971e-53 or 2.8999999999999998e-148 < y Initial program 98.6%
associate-+l-98.6%
sub-neg98.6%
sub-neg98.6%
distribute-neg-in98.6%
unsub-neg98.6%
neg-mul-198.6%
associate-*r/98.6%
associate-*l/98.6%
distribute-neg-frac98.6%
neg-mul-198.6%
times-frac98.6%
distribute-lft-out--98.6%
*-commutative98.6%
associate-/r*98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in y around inf 84.1%
if -5.59999999999999971e-53 < y < 2.8999999999999998e-148Initial program 95.6%
associate-+l-95.6%
sub-neg95.6%
sub-neg95.6%
distribute-neg-in95.6%
unsub-neg95.6%
neg-mul-195.6%
associate-*r/95.6%
associate-*l/95.6%
distribute-neg-frac95.6%
neg-mul-195.6%
times-frac89.1%
distribute-lft-out--89.1%
*-commutative89.1%
associate-/r*89.1%
metadata-eval89.1%
Simplified89.1%
Taylor expanded in y around 0 95.1%
metadata-eval95.1%
associate-/r*88.7%
times-frac88.8%
*-commutative88.8%
associate-*l/88.7%
associate-*r/96.8%
*-commutative96.8%
associate-*r/96.8%
*-rgt-identity96.8%
Simplified96.8%
Taylor expanded in x around 0 73.4%
Final simplification80.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.3e-53)
(+ x (/ y (/ z -0.3333333333333333)))
(if (<= y 3.5e-151)
(* 0.3333333333333333 (/ t (* y z)))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.3e-53) {
tmp = x + (y / (z / -0.3333333333333333));
} else if (y <= 3.5e-151) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = x + (y * (-0.3333333333333333 / 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 (y <= (-3.3d-53)) then
tmp = x + (y / (z / (-0.3333333333333333d0)))
else if (y <= 3.5d-151) then
tmp = 0.3333333333333333d0 * (t / (y * z))
else
tmp = x + (y * ((-0.3333333333333333d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.3e-53) {
tmp = x + (y / (z / -0.3333333333333333));
} else if (y <= 3.5e-151) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.3e-53: tmp = x + (y / (z / -0.3333333333333333)) elif y <= 3.5e-151: tmp = 0.3333333333333333 * (t / (y * z)) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.3e-53) tmp = Float64(x + Float64(y / Float64(z / -0.3333333333333333))); elseif (y <= 3.5e-151) tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); else tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.3e-53) tmp = x + (y / (z / -0.3333333333333333)); elseif (y <= 3.5e-151) tmp = 0.3333333333333333 * (t / (y * z)); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.3e-53], N[(x + N[(y / N[(z / -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e-151], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-53}:\\
\;\;\;\;x + \frac{y}{\frac{z}{-0.3333333333333333}}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-151}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -3.30000000000000004e-53Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
distribute-neg-in99.7%
unsub-neg99.7%
neg-mul-199.7%
associate-*r/99.7%
associate-*l/99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac98.4%
distribute-lft-out--98.4%
*-commutative98.4%
associate-/r*98.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in y around inf 89.7%
div-inv89.7%
Applied egg-rr89.7%
un-div-inv89.7%
associate-*l/89.7%
*-commutative89.7%
associate-/l*89.7%
Applied egg-rr89.7%
if -3.30000000000000004e-53 < y < 3.49999999999999995e-151Initial program 95.6%
associate-+l-95.6%
sub-neg95.6%
sub-neg95.6%
distribute-neg-in95.6%
unsub-neg95.6%
neg-mul-195.6%
associate-*r/95.6%
associate-*l/95.6%
distribute-neg-frac95.6%
neg-mul-195.6%
times-frac89.1%
distribute-lft-out--89.1%
*-commutative89.1%
associate-/r*89.1%
metadata-eval89.1%
Simplified89.1%
Taylor expanded in y around 0 95.1%
metadata-eval95.1%
associate-/r*88.7%
times-frac88.8%
*-commutative88.8%
associate-*l/88.7%
associate-*r/96.8%
*-commutative96.8%
associate-*r/96.8%
*-rgt-identity96.8%
Simplified96.8%
Taylor expanded in x around 0 73.4%
if 3.49999999999999995e-151 < y Initial program 97.7%
associate-+l-97.7%
sub-neg97.7%
sub-neg97.7%
distribute-neg-in97.7%
unsub-neg97.7%
neg-mul-197.7%
associate-*r/97.7%
associate-*l/97.7%
distribute-neg-frac97.7%
neg-mul-197.7%
times-frac98.8%
distribute-lft-out--98.8%
*-commutative98.8%
associate-/r*98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in y around inf 79.9%
Final simplification80.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -3.3e-52)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= y 2.9e-148)
(* 0.3333333333333333 (/ t (* y z)))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.3e-52) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 2.9e-148) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = x + (y * (-0.3333333333333333 / 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 (y <= (-3.3d-52)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (y <= 2.9d-148) then
tmp = 0.3333333333333333d0 * (t / (y * z))
else
tmp = x + (y * ((-0.3333333333333333d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.3e-52) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 2.9e-148) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.3e-52: tmp = x + ((-0.3333333333333333 * y) / z) elif y <= 2.9e-148: tmp = 0.3333333333333333 * (t / (y * z)) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.3e-52) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (y <= 2.9e-148) tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); else tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.3e-52) tmp = x + ((-0.3333333333333333 * y) / z); elseif (y <= 2.9e-148) tmp = 0.3333333333333333 * (t / (y * z)); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.3e-52], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e-148], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-52}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-148}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -3.29999999999999995e-52Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
distribute-neg-in99.7%
unsub-neg99.7%
neg-mul-199.7%
associate-*r/99.7%
associate-*l/99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac98.4%
distribute-lft-out--98.4%
*-commutative98.4%
associate-/r*98.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in y around inf 89.7%
associate-*l/89.7%
Applied egg-rr89.7%
if -3.29999999999999995e-52 < y < 2.8999999999999998e-148Initial program 95.6%
associate-+l-95.6%
sub-neg95.6%
sub-neg95.6%
distribute-neg-in95.6%
unsub-neg95.6%
neg-mul-195.6%
associate-*r/95.6%
associate-*l/95.6%
distribute-neg-frac95.6%
neg-mul-195.6%
times-frac89.1%
distribute-lft-out--89.1%
*-commutative89.1%
associate-/r*89.1%
metadata-eval89.1%
Simplified89.1%
Taylor expanded in y around 0 95.1%
metadata-eval95.1%
associate-/r*88.7%
times-frac88.8%
*-commutative88.8%
associate-*l/88.7%
associate-*r/96.8%
*-commutative96.8%
associate-*r/96.8%
*-rgt-identity96.8%
Simplified96.8%
Taylor expanded in x around 0 73.4%
if 2.8999999999999998e-148 < y Initial program 97.7%
associate-+l-97.7%
sub-neg97.7%
sub-neg97.7%
distribute-neg-in97.7%
unsub-neg97.7%
neg-mul-197.7%
associate-*r/97.7%
associate-*l/97.7%
distribute-neg-frac97.7%
neg-mul-197.7%
times-frac98.8%
distribute-lft-out--98.8%
*-commutative98.8%
associate-/r*98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in y around inf 79.9%
Final simplification80.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.22e-52)
(+ x (/ (* -0.3333333333333333 y) z))
(if (<= y 1.1e-129)
(/ 0.3333333333333333 (* y (/ z t)))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.22e-52) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 1.1e-129) {
tmp = 0.3333333333333333 / (y * (z / t));
} else {
tmp = x + (y * (-0.3333333333333333 / 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 (y <= (-1.22d-52)) then
tmp = x + (((-0.3333333333333333d0) * y) / z)
else if (y <= 1.1d-129) then
tmp = 0.3333333333333333d0 / (y * (z / t))
else
tmp = x + (y * ((-0.3333333333333333d0) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.22e-52) {
tmp = x + ((-0.3333333333333333 * y) / z);
} else if (y <= 1.1e-129) {
tmp = 0.3333333333333333 / (y * (z / t));
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.22e-52: tmp = x + ((-0.3333333333333333 * y) / z) elif y <= 1.1e-129: tmp = 0.3333333333333333 / (y * (z / t)) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.22e-52) tmp = Float64(x + Float64(Float64(-0.3333333333333333 * y) / z)); elseif (y <= 1.1e-129) tmp = Float64(0.3333333333333333 / Float64(y * Float64(z / t))); else tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.22e-52) tmp = x + ((-0.3333333333333333 * y) / z); elseif (y <= 1.1e-129) tmp = 0.3333333333333333 / (y * (z / t)); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.22e-52], N[(x + N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e-129], N[(0.3333333333333333 / N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{-52}:\\
\;\;\;\;x + \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-129}:\\
\;\;\;\;\frac{0.3333333333333333}{y \cdot \frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -1.22e-52Initial program 99.7%
associate-+l-99.7%
sub-neg99.7%
sub-neg99.7%
distribute-neg-in99.7%
unsub-neg99.7%
neg-mul-199.7%
associate-*r/99.7%
associate-*l/99.7%
distribute-neg-frac99.7%
neg-mul-199.7%
times-frac98.4%
distribute-lft-out--98.4%
*-commutative98.4%
associate-/r*98.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in y around inf 89.7%
associate-*l/89.7%
Applied egg-rr89.7%
if -1.22e-52 < y < 1.10000000000000001e-129Initial program 94.7%
associate-+l-94.7%
sub-neg94.7%
sub-neg94.7%
distribute-neg-in94.7%
unsub-neg94.7%
neg-mul-194.7%
associate-*r/94.7%
associate-*l/94.7%
distribute-neg-frac94.7%
neg-mul-194.7%
times-frac89.7%
distribute-lft-out--89.7%
*-commutative89.7%
associate-/r*89.6%
metadata-eval89.6%
Simplified89.6%
Taylor expanded in y around 0 94.3%
metadata-eval94.3%
associate-/r*89.3%
times-frac89.4%
*-commutative89.4%
associate-*l/89.3%
associate-*r/96.9%
*-commutative96.9%
associate-*r/97.0%
*-rgt-identity97.0%
Simplified97.0%
Taylor expanded in x around 0 71.6%
associate-*r/71.6%
*-commutative71.6%
associate-/l*71.6%
associate-/l*67.6%
associate-/r/72.9%
Simplified72.9%
if 1.10000000000000001e-129 < y Initial program 98.7%
associate-+l-98.7%
sub-neg98.7%
sub-neg98.7%
distribute-neg-in98.7%
unsub-neg98.7%
neg-mul-198.7%
associate-*r/98.7%
associate-*l/98.7%
distribute-neg-frac98.7%
neg-mul-198.7%
times-frac98.7%
distribute-lft-out--98.7%
*-commutative98.7%
associate-/r*98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in y around inf 81.9%
Final simplification80.9%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.1e+76) (not (<= y 0.62))) (/ (* -0.3333333333333333 y) z) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.1e+76) || !(y <= 0.62)) {
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 ((y <= (-5.1d+76)) .or. (.not. (y <= 0.62d0))) 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 ((y <= -5.1e+76) || !(y <= 0.62)) {
tmp = (-0.3333333333333333 * y) / z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.1e+76) or not (y <= 0.62): tmp = (-0.3333333333333333 * y) / z else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.1e+76) || !(y <= 0.62)) tmp = Float64(Float64(-0.3333333333333333 * y) / z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.1e+76) || ~((y <= 0.62))) tmp = (-0.3333333333333333 * y) / z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.1e+76], N[Not[LessEqual[y, 0.62]], $MachinePrecision]], N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.1 \cdot 10^{+76} \lor \neg \left(y \leq 0.62\right):\\
\;\;\;\;\frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -5.1000000000000002e76 or 0.619999999999999996 < y Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
sub-neg99.6%
distribute-neg-in99.6%
unsub-neg99.6%
neg-mul-199.6%
associate-*r/99.6%
associate-*l/99.6%
distribute-neg-frac99.6%
neg-mul-199.6%
times-frac99.6%
distribute-lft-out--99.6%
*-commutative99.6%
associate-/r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 76.7%
Taylor expanded in y around inf 73.2%
associate-*r/73.3%
Applied egg-rr73.3%
if -5.1000000000000002e76 < y < 0.619999999999999996Initial program 96.0%
associate-+l-96.0%
sub-neg96.0%
sub-neg96.0%
distribute-neg-in96.0%
unsub-neg96.0%
neg-mul-196.0%
associate-*r/96.0%
associate-*l/96.0%
distribute-neg-frac96.0%
neg-mul-196.0%
times-frac92.2%
distribute-lft-out--92.2%
*-commutative92.2%
associate-/r*92.2%
metadata-eval92.2%
Simplified92.2%
Taylor expanded in x around inf 34.4%
Final simplification50.8%
(FPCore (x y z t) :precision binary64 (if (<= x -1.16e+54) x (if (<= x 1e+89) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.16e+54) {
tmp = x;
} else if (x <= 1e+89) {
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 (x <= (-1.16d+54)) then
tmp = x
else if (x <= 1d+89) 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 (x <= -1.16e+54) {
tmp = x;
} else if (x <= 1e+89) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.16e+54: tmp = x elif x <= 1e+89: tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.16e+54) tmp = x; elseif (x <= 1e+89) 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 (x <= -1.16e+54) tmp = x; elseif (x <= 1e+89) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.16e+54], x, If[LessEqual[x, 1e+89], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.16 \cdot 10^{+54}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 10^{+89}:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.1600000000000001e54 or 9.99999999999999995e88 < x Initial program 98.1%
associate-+l-98.1%
sub-neg98.1%
sub-neg98.1%
distribute-neg-in98.1%
unsub-neg98.1%
neg-mul-198.1%
associate-*r/98.1%
associate-*l/98.0%
distribute-neg-frac98.0%
neg-mul-198.0%
times-frac95.4%
distribute-lft-out--95.4%
*-commutative95.4%
associate-/r*95.4%
metadata-eval95.4%
Simplified95.4%
Taylor expanded in x around inf 57.1%
if -1.1600000000000001e54 < x < 9.99999999999999995e88Initial program 97.2%
associate-+l-97.2%
sub-neg97.2%
sub-neg97.2%
distribute-neg-in97.2%
unsub-neg97.2%
neg-mul-197.2%
associate-*r/97.2%
associate-*l/97.2%
distribute-neg-frac97.2%
neg-mul-197.2%
times-frac95.3%
distribute-lft-out--95.3%
*-commutative95.3%
associate-/r*95.4%
metadata-eval95.4%
Simplified95.4%
Taylor expanded in x around 0 95.3%
Taylor expanded in z around 0 84.2%
Taylor expanded in y around inf 47.9%
Final simplification51.6%
(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 97.5%
associate-+l-97.5%
sub-neg97.5%
sub-neg97.5%
distribute-neg-in97.5%
unsub-neg97.5%
neg-mul-197.5%
associate-*r/97.5%
associate-*l/97.6%
distribute-neg-frac97.6%
neg-mul-197.6%
times-frac95.3%
distribute-lft-out--95.3%
*-commutative95.3%
associate-/r*95.4%
metadata-eval95.4%
Simplified95.4%
Taylor expanded in x around inf 30.4%
Final simplification30.4%
(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 2023213
(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))))