
(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 15 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 (- x (/ y (* z 3.0)))))
(if (<= (* z 3.0) -2e+35)
(+ t_1 (/ t (* z (* y 3.0))))
(if (<= (* z 3.0) 5e-30)
(- x (/ (- y (/ t y)) (* z 3.0)))
(+ t_1 (/ t (* y (* z 3.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = x - (y / (z * 3.0));
double tmp;
if ((z * 3.0) <= -2e+35) {
tmp = t_1 + (t / (z * (y * 3.0)));
} else if ((z * 3.0) <= 5e-30) {
tmp = x - ((y - (t / y)) / (z * 3.0));
} else {
tmp = t_1 + (t / (y * (z * 3.0)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x - (y / (z * 3.0d0))
if ((z * 3.0d0) <= (-2d+35)) then
tmp = t_1 + (t / (z * (y * 3.0d0)))
else if ((z * 3.0d0) <= 5d-30) then
tmp = x - ((y - (t / y)) / (z * 3.0d0))
else
tmp = t_1 + (t / (y * (z * 3.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x - (y / (z * 3.0));
double tmp;
if ((z * 3.0) <= -2e+35) {
tmp = t_1 + (t / (z * (y * 3.0)));
} else if ((z * 3.0) <= 5e-30) {
tmp = x - ((y - (t / y)) / (z * 3.0));
} else {
tmp = t_1 + (t / (y * (z * 3.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = x - (y / (z * 3.0)) tmp = 0 if (z * 3.0) <= -2e+35: tmp = t_1 + (t / (z * (y * 3.0))) elif (z * 3.0) <= 5e-30: tmp = x - ((y - (t / y)) / (z * 3.0)) else: tmp = t_1 + (t / (y * (z * 3.0))) return tmp
function code(x, y, z, t) t_1 = Float64(x - Float64(y / Float64(z * 3.0))) tmp = 0.0 if (Float64(z * 3.0) <= -2e+35) tmp = Float64(t_1 + Float64(t / Float64(z * Float64(y * 3.0)))); elseif (Float64(z * 3.0) <= 5e-30) tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(z * 3.0))); else tmp = Float64(t_1 + Float64(t / Float64(y * Float64(z * 3.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x - (y / (z * 3.0)); tmp = 0.0; if ((z * 3.0) <= -2e+35) tmp = t_1 + (t / (z * (y * 3.0))); elseif ((z * 3.0) <= 5e-30) tmp = x - ((y - (t / y)) / (z * 3.0)); else tmp = t_1 + (t / (y * (z * 3.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * 3.0), $MachinePrecision], -2e+35], N[(t$95$1 + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * 3.0), $MachinePrecision], 5e-30], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(t / N[(y * N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{y}{z \cdot 3}\\
\mathbf{if}\;z \cdot 3 \leq -2 \cdot 10^{+35}:\\
\;\;\;\;t_1 + \frac{t}{z \cdot \left(y \cdot 3\right)}\\
\mathbf{elif}\;z \cdot 3 \leq 5 \cdot 10^{-30}:\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;t_1 + \frac{t}{y \cdot \left(z \cdot 3\right)}\\
\end{array}
\end{array}
if (*.f64 z 3) < -1.9999999999999999e35Initial program 99.6%
associate-*l*99.7%
*-commutative99.7%
Simplified99.7%
if -1.9999999999999999e35 < (*.f64 z 3) < 4.99999999999999972e-30Initial program 91.5%
associate-*l*91.5%
*-commutative91.5%
Simplified91.5%
associate-+l-91.5%
*-commutative91.5%
associate-*l*91.5%
*-commutative91.5%
associate-/r*99.0%
sub-div99.8%
Applied egg-rr99.8%
if 4.99999999999999972e-30 < (*.f64 z 3) Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (or (<= (* z 3.0) -2e+35) (not (<= (* z 3.0) 5e-30))) (+ (- x (/ y (* z 3.0))) (/ t (* z (* y 3.0)))) (- x (/ (- y (/ t y)) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -2e+35) || !((z * 3.0) <= 5e-30)) {
tmp = (x - (y / (z * 3.0))) + (t / (z * (y * 3.0)));
} else {
tmp = x - ((y - (t / y)) / (z * 3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((z * 3.0d0) <= (-2d+35)) .or. (.not. ((z * 3.0d0) <= 5d-30))) then
tmp = (x - (y / (z * 3.0d0))) + (t / (z * (y * 3.0d0)))
else
tmp = x - ((y - (t / y)) / (z * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -2e+35) || !((z * 3.0) <= 5e-30)) {
tmp = (x - (y / (z * 3.0))) + (t / (z * (y * 3.0)));
} else {
tmp = x - ((y - (t / y)) / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * 3.0) <= -2e+35) or not ((z * 3.0) <= 5e-30): tmp = (x - (y / (z * 3.0))) + (t / (z * (y * 3.0))) else: tmp = x - ((y - (t / y)) / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z * 3.0) <= -2e+35) || !(Float64(z * 3.0) <= 5e-30)) tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(z * Float64(y * 3.0)))); else tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * 3.0) <= -2e+35) || ~(((z * 3.0) <= 5e-30))) tmp = (x - (y / (z * 3.0))) + (t / (z * (y * 3.0))); else tmp = x - ((y - (t / y)) / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * 3.0), $MachinePrecision], -2e+35], N[Not[LessEqual[N[(z * 3.0), $MachinePrecision], 5e-30]], $MachinePrecision]], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(z * N[(y * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -2 \cdot 10^{+35} \lor \neg \left(z \cdot 3 \leq 5 \cdot 10^{-30}\right):\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{z \cdot \left(y \cdot 3\right)}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{z \cdot 3}\\
\end{array}
\end{array}
if (*.f64 z 3) < -1.9999999999999999e35 or 4.99999999999999972e-30 < (*.f64 z 3) Initial program 99.7%
associate-*l*99.7%
*-commutative99.7%
Simplified99.7%
if -1.9999999999999999e35 < (*.f64 z 3) < 4.99999999999999972e-30Initial program 91.5%
associate-*l*91.5%
*-commutative91.5%
Simplified91.5%
associate-+l-91.5%
*-commutative91.5%
associate-*l*91.5%
*-commutative91.5%
associate-/r*99.0%
sub-div99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* t (/ (/ 0.3333333333333333 z) y)))))
(if (<= y -530000000000.0)
(- x (* 0.3333333333333333 (/ y z)))
(if (<= y 5.2e-165)
t_1
(if (<= y 1.16e-110)
(* (/ 0.3333333333333333 z) (- (/ t y) y))
(if (<= y 3.1e+28) t_1 (+ x (* y (/ -0.3333333333333333 z)))))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (t * ((0.3333333333333333 / z) / y));
double tmp;
if (y <= -530000000000.0) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 5.2e-165) {
tmp = t_1;
} else if (y <= 1.16e-110) {
tmp = (0.3333333333333333 / z) * ((t / y) - y);
} else if (y <= 3.1e+28) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (t * ((0.3333333333333333d0 / z) / y))
if (y <= (-530000000000.0d0)) then
tmp = x - (0.3333333333333333d0 * (y / z))
else if (y <= 5.2d-165) then
tmp = t_1
else if (y <= 1.16d-110) then
tmp = (0.3333333333333333d0 / z) * ((t / y) - y)
else if (y <= 3.1d+28) then
tmp = t_1
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 t_1 = x + (t * ((0.3333333333333333 / z) / y));
double tmp;
if (y <= -530000000000.0) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 5.2e-165) {
tmp = t_1;
} else if (y <= 1.16e-110) {
tmp = (0.3333333333333333 / z) * ((t / y) - y);
} else if (y <= 3.1e+28) {
tmp = t_1;
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (t * ((0.3333333333333333 / z) / y)) tmp = 0 if y <= -530000000000.0: tmp = x - (0.3333333333333333 * (y / z)) elif y <= 5.2e-165: tmp = t_1 elif y <= 1.16e-110: tmp = (0.3333333333333333 / z) * ((t / y) - y) elif y <= 3.1e+28: tmp = t_1 else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(t * Float64(Float64(0.3333333333333333 / z) / y))) tmp = 0.0 if (y <= -530000000000.0) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); elseif (y <= 5.2e-165) tmp = t_1; elseif (y <= 1.16e-110) tmp = Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y)); elseif (y <= 3.1e+28) tmp = t_1; else tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (t * ((0.3333333333333333 / z) / y)); tmp = 0.0; if (y <= -530000000000.0) tmp = x - (0.3333333333333333 * (y / z)); elseif (y <= 5.2e-165) tmp = t_1; elseif (y <= 1.16e-110) tmp = (0.3333333333333333 / z) * ((t / y) - y); elseif (y <= 3.1e+28) tmp = t_1; else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(t * N[(N[(0.3333333333333333 / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -530000000000.0], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e-165], t$95$1, If[LessEqual[y, 1.16e-110], N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.1e+28], t$95$1, N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot \frac{\frac{0.3333333333333333}{z}}{y}\\
\mathbf{if}\;y \leq -530000000000:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-165}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{-110}:\\
\;\;\;\;\frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+28}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -5.3e11Initial program 98.3%
associate-*l*98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in t around 0 95.6%
if -5.3e11 < y < 5.20000000000000015e-165 or 1.16000000000000001e-110 < y < 3.1000000000000001e28Initial program 95.6%
Simplified89.6%
Taylor expanded in t around inf 92.3%
*-commutative92.3%
metadata-eval92.3%
times-frac92.4%
*-commutative92.4%
times-frac92.3%
associate-/r*92.3%
times-frac86.3%
*-commutative86.3%
associate-*r/92.3%
associate-/l/92.3%
associate-/r*92.3%
*-commutative92.3%
associate-/r*92.2%
metadata-eval92.2%
Simplified92.2%
if 5.20000000000000015e-165 < y < 1.16000000000000001e-110Initial program 63.3%
associate-*l*63.4%
*-commutative63.4%
Simplified63.4%
+-commutative63.4%
*-commutative63.4%
associate-*l*63.3%
associate-+r-63.3%
associate-*l*63.4%
*-commutative63.4%
associate-/r*100.0%
div-inv100.0%
metadata-eval100.0%
div-inv100.0%
clear-num100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 88.2%
distribute-lft-out--88.2%
associate-*l/88.1%
*-commutative88.1%
Simplified88.1%
if 3.1000000000000001e28 < y Initial program 99.9%
Simplified99.8%
Taylor expanded in t around 0 96.7%
*-commutative96.7%
associate-*l/96.7%
associate-*r/96.8%
Simplified96.8%
Final simplification94.0%
(FPCore (x y z t)
:precision binary64
(if (<= (* z 3.0) -1e+63)
(+ x (* y (/ -0.3333333333333333 z)))
(if (<= (* z 3.0) 2e+20)
(* (/ 0.3333333333333333 z) (- (/ t y) y))
(- x (* 0.3333333333333333 (/ y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -1e+63) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if ((z * 3.0) <= 2e+20) {
tmp = (0.3333333333333333 / z) * ((t / y) - y);
} else {
tmp = x - (0.3333333333333333 * (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 ((z * 3.0d0) <= (-1d+63)) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else if ((z * 3.0d0) <= 2d+20) then
tmp = (0.3333333333333333d0 / z) * ((t / y) - y)
else
tmp = x - (0.3333333333333333d0 * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -1e+63) {
tmp = x + (y * (-0.3333333333333333 / z));
} else if ((z * 3.0) <= 2e+20) {
tmp = (0.3333333333333333 / z) * ((t / y) - y);
} else {
tmp = x - (0.3333333333333333 * (y / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -1e+63: tmp = x + (y * (-0.3333333333333333 / z)) elif (z * 3.0) <= 2e+20: tmp = (0.3333333333333333 / z) * ((t / y) - y) else: tmp = x - (0.3333333333333333 * (y / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -1e+63) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); elseif (Float64(z * 3.0) <= 2e+20) tmp = Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y)); else tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -1e+63) tmp = x + (y * (-0.3333333333333333 / z)); elseif ((z * 3.0) <= 2e+20) tmp = (0.3333333333333333 / z) * ((t / y) - y); else tmp = x - (0.3333333333333333 * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -1e+63], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * 3.0), $MachinePrecision], 2e+20], N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -1 \cdot 10^{+63}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{elif}\;z \cdot 3 \leq 2 \cdot 10^{+20}:\\
\;\;\;\;\frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)\\
\mathbf{else}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\end{array}
\end{array}
if (*.f64 z 3) < -1.00000000000000006e63Initial program 99.7%
Simplified89.2%
Taylor expanded in t around 0 83.7%
*-commutative83.7%
associate-*l/83.8%
associate-*r/83.8%
Simplified83.8%
if -1.00000000000000006e63 < (*.f64 z 3) < 2e20Initial program 92.3%
associate-*l*92.3%
*-commutative92.3%
Simplified92.3%
+-commutative92.3%
*-commutative92.3%
associate-*l*92.3%
associate-+r-92.3%
associate-*l*92.3%
*-commutative92.3%
associate-/r*95.5%
div-inv95.5%
metadata-eval95.5%
div-inv95.4%
clear-num95.4%
Applied egg-rr95.4%
Taylor expanded in z around 0 91.7%
distribute-lft-out--91.7%
associate-*l/91.6%
*-commutative91.6%
Simplified91.6%
if 2e20 < (*.f64 z 3) Initial program 99.8%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 74.4%
Final simplification85.7%
(FPCore (x y z t) :precision binary64 (if (<= y 7.5e-174) (- (+ (/ (/ t z) (* y 3.0)) x) (* y (/ 0.3333333333333333 z))) (- x (/ (- y (/ t y)) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.5e-174) {
tmp = (((t / z) / (y * 3.0)) + x) - (y * (0.3333333333333333 / z));
} else {
tmp = x - ((y - (t / y)) / (z * 3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 7.5d-174) then
tmp = (((t / z) / (y * 3.0d0)) + x) - (y * (0.3333333333333333d0 / z))
else
tmp = x - ((y - (t / y)) / (z * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.5e-174) {
tmp = (((t / z) / (y * 3.0)) + x) - (y * (0.3333333333333333 / z));
} else {
tmp = x - ((y - (t / y)) / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 7.5e-174: tmp = (((t / z) / (y * 3.0)) + x) - (y * (0.3333333333333333 / z)) else: tmp = x - ((y - (t / y)) / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 7.5e-174) tmp = Float64(Float64(Float64(Float64(t / z) / Float64(y * 3.0)) + x) - Float64(y * Float64(0.3333333333333333 / z))); else tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 7.5e-174) tmp = (((t / z) / (y * 3.0)) + x) - (y * (0.3333333333333333 / z)); else tmp = x - ((y - (t / y)) / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 7.5e-174], N[(N[(N[(N[(t / z), $MachinePrecision] / N[(y * 3.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] - N[(y * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.5 \cdot 10^{-174}:\\
\;\;\;\;\left(\frac{\frac{t}{z}}{y \cdot 3} + x\right) - y \cdot \frac{0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{z \cdot 3}\\
\end{array}
\end{array}
if y < 7.5000000000000003e-174Initial program 96.1%
associate-*l*96.1%
*-commutative96.1%
Simplified96.1%
+-commutative96.1%
*-commutative96.1%
associate-*l*96.1%
associate-+r-96.1%
associate-*l*96.1%
*-commutative96.1%
associate-/r*97.9%
div-inv97.9%
metadata-eval97.9%
div-inv97.8%
clear-num97.8%
Applied egg-rr97.8%
if 7.5000000000000003e-174 < y Initial program 95.2%
associate-*l*95.2%
*-commutative95.2%
Simplified95.2%
associate-+l-95.2%
*-commutative95.2%
associate-*l*95.2%
*-commutative95.2%
associate-/r*99.8%
sub-div99.8%
Applied egg-rr99.8%
Final simplification98.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -50000000000.0)
(- x (* 0.3333333333333333 (/ y z)))
(if (<= y 2.9e+22)
(+ x (/ (* t (/ 0.3333333333333333 z)) y))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -50000000000.0) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 2.9e+22) {
tmp = x + ((t * (0.3333333333333333 / z)) / 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 <= (-50000000000.0d0)) then
tmp = x - (0.3333333333333333d0 * (y / z))
else if (y <= 2.9d+22) then
tmp = x + ((t * (0.3333333333333333d0 / z)) / 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 <= -50000000000.0) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 2.9e+22) {
tmp = x + ((t * (0.3333333333333333 / z)) / y);
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -50000000000.0: tmp = x - (0.3333333333333333 * (y / z)) elif y <= 2.9e+22: tmp = x + ((t * (0.3333333333333333 / z)) / y) else: tmp = x + (y * (-0.3333333333333333 / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -50000000000.0) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); elseif (y <= 2.9e+22) tmp = Float64(x + Float64(Float64(t * Float64(0.3333333333333333 / z)) / 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 <= -50000000000.0) tmp = x - (0.3333333333333333 * (y / z)); elseif (y <= 2.9e+22) tmp = x + ((t * (0.3333333333333333 / z)) / y); else tmp = x + (y * (-0.3333333333333333 / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -50000000000.0], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+22], N[(x + N[(N[(t * N[(0.3333333333333333 / z), $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 -50000000000:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{t \cdot \frac{0.3333333333333333}{z}}{y}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -5e10Initial program 98.3%
associate-*l*98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in t around 0 95.6%
if -5e10 < y < 2.9e22Initial program 92.2%
Simplified90.6%
Taylor expanded in t around inf 88.4%
*-commutative88.4%
metadata-eval88.4%
times-frac88.5%
*-commutative88.5%
times-frac88.5%
associate-/r*88.5%
times-frac86.2%
*-commutative86.2%
associate-*r/88.5%
associate-/l/88.5%
associate-/r*88.4%
*-commutative88.4%
associate-/r*88.4%
metadata-eval88.4%
Simplified88.4%
associate-*r/92.9%
Applied egg-rr92.9%
if 2.9e22 < y Initial program 99.9%
Simplified99.8%
Taylor expanded in t around 0 96.7%
*-commutative96.7%
associate-*l/96.7%
associate-*r/96.8%
Simplified96.8%
Final simplification94.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -57000.0)
(/ (* y -0.3333333333333333) z)
(if (<= y 5.5e-121)
(* 0.3333333333333333 (/ t (* y z)))
(if (<= y 3.2e+160) x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -57000.0) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 5.5e-121) {
tmp = 0.3333333333333333 * (t / (y * z));
} else if (y <= 3.2e+160) {
tmp = x;
} else {
tmp = 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 <= (-57000.0d0)) then
tmp = (y * (-0.3333333333333333d0)) / z
else if (y <= 5.5d-121) then
tmp = 0.3333333333333333d0 * (t / (y * z))
else if (y <= 3.2d+160) then
tmp = x
else
tmp = 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 <= -57000.0) {
tmp = (y * -0.3333333333333333) / z;
} else if (y <= 5.5e-121) {
tmp = 0.3333333333333333 * (t / (y * z));
} else if (y <= 3.2e+160) {
tmp = x;
} else {
tmp = y * (-0.3333333333333333 / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -57000.0: tmp = (y * -0.3333333333333333) / z elif y <= 5.5e-121: tmp = 0.3333333333333333 * (t / (y * z)) elif y <= 3.2e+160: tmp = x else: tmp = y * (-0.3333333333333333 / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -57000.0) tmp = Float64(Float64(y * -0.3333333333333333) / z); elseif (y <= 5.5e-121) tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); elseif (y <= 3.2e+160) tmp = x; else tmp = Float64(y * Float64(-0.3333333333333333 / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -57000.0) tmp = (y * -0.3333333333333333) / z; elseif (y <= 5.5e-121) tmp = 0.3333333333333333 * (t / (y * z)); elseif (y <= 3.2e+160) tmp = x; else tmp = y * (-0.3333333333333333 / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -57000.0], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[y, 5.5e-121], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+160], x, N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -57000:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-121}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+160}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -57000Initial program 98.3%
associate-*l*98.3%
*-commutative98.3%
Simplified98.3%
+-commutative98.3%
*-commutative98.3%
associate-*l*98.3%
associate-+r-98.3%
associate-*l*98.3%
*-commutative98.3%
associate-/r*98.3%
div-inv98.2%
metadata-eval98.2%
div-inv98.0%
clear-num98.1%
Applied egg-rr98.1%
Taylor expanded in y around inf 68.3%
associate-*r/68.3%
*-commutative68.3%
Simplified68.3%
if -57000 < y < 5.50000000000000031e-121Initial program 91.3%
associate-*l*91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in z around 0 66.7%
clear-num66.7%
inv-pow66.7%
*-un-lft-identity66.7%
distribute-lft-out--66.7%
times-frac66.8%
metadata-eval66.8%
Applied egg-rr66.8%
unpow-166.8%
Simplified66.8%
Taylor expanded in t around inf 67.6%
*-commutative67.6%
Simplified67.6%
if 5.50000000000000031e-121 < y < 3.1999999999999998e160Initial program 97.6%
Simplified99.8%
Taylor expanded in x around inf 54.7%
if 3.1999999999999998e160 < y Initial program 99.9%
associate-*l*99.9%
*-commutative99.9%
Simplified99.9%
+-commutative99.9%
*-commutative99.9%
associate-*l*99.9%
associate-+r-99.9%
associate-*l*99.9%
*-commutative99.9%
associate-/r*91.0%
div-inv91.0%
metadata-eval91.0%
div-inv91.0%
clear-num90.9%
Applied egg-rr90.9%
Taylor expanded in y around inf 82.4%
associate-*r/82.5%
associate-*l/82.5%
metadata-eval82.5%
distribute-neg-frac82.5%
*-commutative82.5%
distribute-neg-frac82.5%
metadata-eval82.5%
Simplified82.5%
Final simplification68.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.9e-52) (not (<= y 2.8e-121))) (+ x (* y (/ -0.3333333333333333 z))) (* 0.3333333333333333 (/ t (* y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.9e-52) || !(y <= 2.8e-121)) {
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 <= (-2.9d-52)) .or. (.not. (y <= 2.8d-121))) 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 <= -2.9e-52) || !(y <= 2.8e-121)) {
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 <= -2.9e-52) or not (y <= 2.8e-121): 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 <= -2.9e-52) || !(y <= 2.8e-121)) 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 <= -2.9e-52) || ~((y <= 2.8e-121))) 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, -2.9e-52], N[Not[LessEqual[y, 2.8e-121]], $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 -2.9 \cdot 10^{-52} \lor \neg \left(y \leq 2.8 \cdot 10^{-121}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\end{array}
\end{array}
if y < -2.9000000000000002e-52 or 2.8000000000000001e-121 < y Initial program 98.6%
Simplified99.7%
Taylor expanded in t around 0 90.1%
*-commutative90.1%
associate-*l/90.1%
associate-*r/90.1%
Simplified90.1%
if -2.9000000000000002e-52 < y < 2.8000000000000001e-121Initial program 91.1%
associate-*l*91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in z around 0 67.1%
clear-num67.0%
inv-pow67.0%
*-un-lft-identity67.0%
distribute-lft-out--67.0%
times-frac67.1%
metadata-eval67.1%
Applied egg-rr67.1%
unpow-167.1%
Simplified67.1%
Taylor expanded in t around inf 68.0%
*-commutative68.0%
Simplified68.0%
Final simplification81.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -2.4e-32)
(- x (* 0.3333333333333333 (/ y z)))
(if (<= y 7e-114)
(* 0.3333333333333333 (/ t (* y z)))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.4e-32) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 7e-114) {
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 <= (-2.4d-32)) then
tmp = x - (0.3333333333333333d0 * (y / z))
else if (y <= 7d-114) 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 <= -2.4e-32) {
tmp = x - (0.3333333333333333 * (y / z));
} else if (y <= 7e-114) {
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 <= -2.4e-32: tmp = x - (0.3333333333333333 * (y / z)) elif y <= 7e-114: 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 <= -2.4e-32) tmp = Float64(x - Float64(0.3333333333333333 * Float64(y / z))); elseif (y <= 7e-114) 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 <= -2.4e-32) tmp = x - (0.3333333333333333 * (y / z)); elseif (y <= 7e-114) 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, -2.4e-32], N[(x - N[(0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e-114], 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 -2.4 \cdot 10^{-32}:\\
\;\;\;\;x - 0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-114}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if y < -2.4000000000000001e-32Initial program 98.3%
associate-*l*98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in t around 0 94.3%
if -2.4000000000000001e-32 < y < 7e-114Initial program 91.1%
associate-*l*91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in z around 0 67.1%
clear-num67.0%
inv-pow67.0%
*-un-lft-identity67.0%
distribute-lft-out--67.0%
times-frac67.1%
metadata-eval67.1%
Applied egg-rr67.1%
unpow-167.1%
Simplified67.1%
Taylor expanded in t around inf 68.0%
*-commutative68.0%
Simplified68.0%
if 7e-114 < y Initial program 98.8%
Simplified99.8%
Taylor expanded in t around 0 86.7%
*-commutative86.7%
associate-*l/86.7%
associate-*r/86.8%
Simplified86.8%
Final simplification81.7%
(FPCore (x y z t) :precision binary64 (+ x (* (/ 0.3333333333333333 z) (- (/ t y) y))))
double code(double x, double y, double z, double t) {
return x + ((0.3333333333333333 / z) * ((t / y) - 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 / z) * ((t / y) - y))
end function
public static double code(double x, double y, double z, double t) {
return x + ((0.3333333333333333 / z) * ((t / y) - y));
}
def code(x, y, z, t): return x + ((0.3333333333333333 / z) * ((t / y) - y))
function code(x, y, z, t) return Float64(x + Float64(Float64(0.3333333333333333 / z) * Float64(Float64(t / y) - y))) end
function tmp = code(x, y, z, t) tmp = x + ((0.3333333333333333 / z) * ((t / y) - y)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(0.3333333333333333 / z), $MachinePrecision] * N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{0.3333333333333333}{z} \cdot \left(\frac{t}{y} - y\right)
\end{array}
Initial program 95.7%
Simplified95.3%
Final simplification95.3%
(FPCore (x y z t) :precision binary64 (- x (/ (- y (/ t y)) (* z 3.0))))
double code(double x, double y, double z, double t) {
return x - ((y - (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 - (t / y)) / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return x - ((y - (t / y)) / (z * 3.0));
}
def code(x, y, z, t): return x - ((y - (t / y)) / (z * 3.0))
function code(x, y, z, t) return Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(z * 3.0))) end
function tmp = code(x, y, z, t) tmp = x - ((y - (t / y)) / (z * 3.0)); end
code[x_, y_, z_, t_] := N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - \frac{t}{y}}{z \cdot 3}
\end{array}
Initial program 95.7%
associate-*l*95.7%
*-commutative95.7%
Simplified95.7%
associate-+l-95.7%
*-commutative95.7%
associate-*l*95.7%
*-commutative95.7%
associate-/r*95.0%
sub-div95.4%
Applied egg-rr95.4%
Final simplification95.4%
(FPCore (x y z t) :precision binary64 (if (<= x -4.5e+93) x (if (<= x 7.8e+114) (* (/ y z) -0.3333333333333333) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.5e+93) {
tmp = x;
} else if (x <= 7.8e+114) {
tmp = (y / z) * -0.3333333333333333;
} 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 <= (-4.5d+93)) then
tmp = x
else if (x <= 7.8d+114) then
tmp = (y / z) * (-0.3333333333333333d0)
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 <= -4.5e+93) {
tmp = x;
} else if (x <= 7.8e+114) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.5e+93: tmp = x elif x <= 7.8e+114: tmp = (y / z) * -0.3333333333333333 else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.5e+93) tmp = x; elseif (x <= 7.8e+114) tmp = Float64(Float64(y / z) * -0.3333333333333333); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.5e+93) tmp = x; elseif (x <= 7.8e+114) tmp = (y / z) * -0.3333333333333333; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.5e+93], x, If[LessEqual[x, 7.8e+114], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+93}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{+114}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.49999999999999991e93 or 7.8000000000000001e114 < x Initial program 98.8%
Simplified94.4%
Taylor expanded in x around inf 61.4%
if -4.49999999999999991e93 < x < 7.8000000000000001e114Initial program 94.2%
associate-*l*94.2%
*-commutative94.2%
Simplified94.2%
+-commutative94.2%
*-commutative94.2%
associate-*l*94.2%
associate-+r-94.2%
associate-*l*94.2%
*-commutative94.2%
associate-/r*95.1%
div-inv95.0%
metadata-eval95.0%
div-inv95.0%
clear-num95.0%
Applied egg-rr95.0%
Taylor expanded in y around inf 49.5%
Final simplification53.5%
(FPCore (x y z t) :precision binary64 (if (<= x -5.5e+93) x (if (<= x 2.25e+114) (* y (/ -0.3333333333333333 z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.5e+93) {
tmp = x;
} else if (x <= 2.25e+114) {
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 (x <= (-5.5d+93)) then
tmp = x
else if (x <= 2.25d+114) 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 (x <= -5.5e+93) {
tmp = x;
} else if (x <= 2.25e+114) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.5e+93: tmp = x elif x <= 2.25e+114: tmp = y * (-0.3333333333333333 / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.5e+93) tmp = x; elseif (x <= 2.25e+114) 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 (x <= -5.5e+93) tmp = x; elseif (x <= 2.25e+114) tmp = y * (-0.3333333333333333 / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.5e+93], x, If[LessEqual[x, 2.25e+114], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{+93}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{+114}:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.5000000000000003e93 or 2.25e114 < x Initial program 98.8%
Simplified94.4%
Taylor expanded in x around inf 61.4%
if -5.5000000000000003e93 < x < 2.25e114Initial program 94.2%
associate-*l*94.2%
*-commutative94.2%
Simplified94.2%
+-commutative94.2%
*-commutative94.2%
associate-*l*94.2%
associate-+r-94.2%
associate-*l*94.2%
*-commutative94.2%
associate-/r*95.1%
div-inv95.0%
metadata-eval95.0%
div-inv95.0%
clear-num95.0%
Applied egg-rr95.0%
Taylor expanded in y around inf 49.5%
associate-*r/49.5%
associate-*l/49.5%
metadata-eval49.5%
distribute-neg-frac49.5%
*-commutative49.5%
distribute-neg-frac49.5%
metadata-eval49.5%
Simplified49.5%
Final simplification53.6%
(FPCore (x y z t) :precision binary64 (if (<= x -6.8e+92) x (if (<= x 2.9e+114) (/ (* y -0.3333333333333333) z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.8e+92) {
tmp = x;
} else if (x <= 2.9e+114) {
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 (x <= (-6.8d+92)) then
tmp = x
else if (x <= 2.9d+114) 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 (x <= -6.8e+92) {
tmp = x;
} else if (x <= 2.9e+114) {
tmp = (y * -0.3333333333333333) / z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.8e+92: tmp = x elif x <= 2.9e+114: tmp = (y * -0.3333333333333333) / z else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.8e+92) tmp = x; elseif (x <= 2.9e+114) tmp = Float64(Float64(y * -0.3333333333333333) / z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -6.8e+92) tmp = x; elseif (x <= 2.9e+114) tmp = (y * -0.3333333333333333) / z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.8e+92], x, If[LessEqual[x, 2.9e+114], N[(N[(y * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+92}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+114}:\\
\;\;\;\;\frac{y \cdot -0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.7999999999999996e92 or 2.9e114 < x Initial program 98.8%
Simplified94.4%
Taylor expanded in x around inf 61.4%
if -6.7999999999999996e92 < x < 2.9e114Initial program 94.2%
associate-*l*94.2%
*-commutative94.2%
Simplified94.2%
+-commutative94.2%
*-commutative94.2%
associate-*l*94.2%
associate-+r-94.2%
associate-*l*94.2%
*-commutative94.2%
associate-/r*95.1%
div-inv95.0%
metadata-eval95.0%
div-inv95.0%
clear-num95.0%
Applied egg-rr95.0%
Taylor expanded in y around inf 49.5%
associate-*r/49.5%
*-commutative49.5%
Simplified49.5%
Final simplification53.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 95.7%
Simplified95.3%
Taylor expanded in x around inf 30.1%
Final simplification30.1%
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y)))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + ((t / (z * 3.0d0)) / y)
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y);
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y)
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(Float64(t / Float64(z * 3.0)) / y)) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + ((t / (z * 3.0)) / y); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}
herbie shell --seed 2024011
(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))))