
(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 14 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 (/ t (* z (* 3.0 y)))))
(if (<= (* z 3.0) -5.0)
(+ (+ t_1 x) (/ y (* z -3.0)))
(if (<= (* z 3.0) 2e-10)
(+ x (/ (- (/ t y) y) (* z 3.0)))
(+ x (fma -0.3333333333333333 (/ y z) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = t / (z * (3.0 * y));
double tmp;
if ((z * 3.0) <= -5.0) {
tmp = (t_1 + x) + (y / (z * -3.0));
} else if ((z * 3.0) <= 2e-10) {
tmp = x + (((t / y) - y) / (z * 3.0));
} else {
tmp = x + fma(-0.3333333333333333, (y / z), t_1);
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(t / Float64(z * Float64(3.0 * y))) tmp = 0.0 if (Float64(z * 3.0) <= -5.0) tmp = Float64(Float64(t_1 + x) + Float64(y / Float64(z * -3.0))); elseif (Float64(z * 3.0) <= 2e-10) tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); else tmp = Float64(x + fma(-0.3333333333333333, Float64(y / z), t_1)); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t / N[(z * N[(3.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * 3.0), $MachinePrecision], -5.0], N[(N[(t$95$1 + x), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * 3.0), $MachinePrecision], 2e-10], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{z \cdot \left(3 \cdot y\right)}\\
\mathbf{if}\;z \cdot 3 \leq -5:\\
\;\;\;\;\left(t\_1 + x\right) + \frac{y}{z \cdot -3}\\
\mathbf{elif}\;z \cdot 3 \leq 2 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;x + \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, t\_1\right)\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -5Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
sub-neg99.8%
associate-*l*99.9%
*-commutative99.9%
distribute-frac-neg299.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
if -5 < (*.f64 z #s(literal 3 binary64)) < 2.00000000000000007e-10Initial program 91.6%
sub-neg91.6%
associate-+l+91.6%
+-commutative91.6%
remove-double-neg91.6%
distribute-frac-neg91.6%
distribute-neg-in91.6%
remove-double-neg91.6%
sub-neg91.6%
neg-mul-191.6%
times-frac98.4%
distribute-frac-neg98.4%
neg-mul-198.4%
*-commutative98.4%
associate-/l*98.4%
*-commutative98.4%
Simplified99.8%
*-commutative99.8%
clear-num99.8%
div-inv99.8%
metadata-eval99.8%
un-div-inv99.9%
Applied egg-rr99.9%
if 2.00000000000000007e-10 < (*.f64 z #s(literal 3 binary64)) Initial program 99.7%
sub-neg99.7%
associate-+l+99.7%
distribute-frac-neg99.7%
neg-mul-199.7%
*-commutative99.7%
times-frac99.7%
fma-define99.7%
metadata-eval99.7%
associate-*l*99.8%
*-commutative99.8%
Simplified99.8%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (* z 3.0) -5.0) (not (<= (* z 3.0) 2e-10))) (+ (+ (/ t (* z (* 3.0 y))) x) (/ y (* z -3.0))) (+ x (/ (- (/ t y) y) (* z 3.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -5.0) || !((z * 3.0) <= 2e-10)) {
tmp = ((t / (z * (3.0 * y))) + x) + (y / (z * -3.0));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (((z * 3.0d0) <= (-5.0d0)) .or. (.not. ((z * 3.0d0) <= 2d-10))) then
tmp = ((t / (z * (3.0d0 * y))) + x) + (y / (z * (-3.0d0)))
else
tmp = x + (((t / y) - y) / (z * 3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -5.0) || !((z * 3.0) <= 2e-10)) {
tmp = ((t / (z * (3.0 * y))) + x) + (y / (z * -3.0));
} else {
tmp = x + (((t / y) - y) / (z * 3.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * 3.0) <= -5.0) or not ((z * 3.0) <= 2e-10): tmp = ((t / (z * (3.0 * y))) + x) + (y / (z * -3.0)) else: tmp = x + (((t / y) - y) / (z * 3.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z * 3.0) <= -5.0) || !(Float64(z * 3.0) <= 2e-10)) tmp = Float64(Float64(Float64(t / Float64(z * Float64(3.0 * y))) + x) + Float64(y / Float64(z * -3.0))); else tmp = Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * 3.0) <= -5.0) || ~(((z * 3.0) <= 2e-10))) tmp = ((t / (z * (3.0 * y))) + x) + (y / (z * -3.0)); else tmp = x + (((t / y) - y) / (z * 3.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * 3.0), $MachinePrecision], -5.0], N[Not[LessEqual[N[(z * 3.0), $MachinePrecision], 2e-10]], $MachinePrecision]], N[(N[(N[(t / N[(z * N[(3.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + N[(y / N[(z * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -5 \lor \neg \left(z \cdot 3 \leq 2 \cdot 10^{-10}\right):\\
\;\;\;\;\left(\frac{t}{z \cdot \left(3 \cdot y\right)} + x\right) + \frac{y}{z \cdot -3}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\frac{t}{y} - y}{z \cdot 3}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -5 or 2.00000000000000007e-10 < (*.f64 z #s(literal 3 binary64)) Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
sub-neg99.8%
associate-*l*99.8%
*-commutative99.8%
distribute-frac-neg299.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
if -5 < (*.f64 z #s(literal 3 binary64)) < 2.00000000000000007e-10Initial program 91.6%
sub-neg91.6%
associate-+l+91.6%
+-commutative91.6%
remove-double-neg91.6%
distribute-frac-neg91.6%
distribute-neg-in91.6%
remove-double-neg91.6%
sub-neg91.6%
neg-mul-191.6%
times-frac98.4%
distribute-frac-neg98.4%
neg-mul-198.4%
*-commutative98.4%
associate-/l*98.4%
*-commutative98.4%
Simplified99.8%
*-commutative99.8%
clear-num99.8%
div-inv99.8%
metadata-eval99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= (* z 3.0) -2e+59) (not (<= (* z 3.0) 0.2))) (+ x (* 0.3333333333333333 (/ t (* z y)))) (* 0.3333333333333333 (/ (- (/ t y) y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (((z * 3.0) <= -2e+59) || !((z * 3.0) <= 0.2)) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = 0.3333333333333333 * (((t / y) - 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) <= (-2d+59)) .or. (.not. ((z * 3.0d0) <= 0.2d0))) then
tmp = x + (0.3333333333333333d0 * (t / (z * y)))
else
tmp = 0.3333333333333333d0 * (((t / y) - 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) <= -2e+59) || !((z * 3.0) <= 0.2)) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((z * 3.0) <= -2e+59) or not ((z * 3.0) <= 0.2): tmp = x + (0.3333333333333333 * (t / (z * y))) else: tmp = 0.3333333333333333 * (((t / y) - y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(z * 3.0) <= -2e+59) || !(Float64(z * 3.0) <= 0.2)) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(z * y)))); else tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((z * 3.0) <= -2e+59) || ~(((z * 3.0) <= 0.2))) tmp = x + (0.3333333333333333 * (t / (z * y))); else tmp = 0.3333333333333333 * (((t / y) - y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * 3.0), $MachinePrecision], -2e+59], N[Not[LessEqual[N[(z * 3.0), $MachinePrecision], 0.2]], $MachinePrecision]], N[(x + N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -2 \cdot 10^{+59} \lor \neg \left(z \cdot 3 \leq 0.2\right):\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -1.99999999999999994e59 or 0.20000000000000001 < (*.f64 z #s(literal 3 binary64)) Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac88.3%
distribute-frac-neg88.3%
neg-mul-188.3%
*-commutative88.3%
associate-/l*88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in t around inf 84.5%
if -1.99999999999999994e59 < (*.f64 z #s(literal 3 binary64)) < 0.20000000000000001Initial program 92.7%
Taylor expanded in z around 0 93.3%
Taylor expanded in t around 0 87.7%
+-commutative87.7%
*-commutative87.7%
metadata-eval87.7%
cancel-sign-sub-inv87.7%
distribute-lft-out--87.7%
*-commutative87.7%
associate-/r*91.5%
div-sub92.8%
Simplified92.8%
Final simplification89.6%
(FPCore (x y z t)
:precision binary64
(if (<= (* z 3.0) -5e+83)
(- x (/ y (* z 3.0)))
(if (<= (* z 3.0) 2e+46)
(* 0.3333333333333333 (/ (- (/ t y) y) z))
(+ x (* y (/ -0.3333333333333333 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -5e+83) {
tmp = x - (y / (z * 3.0));
} else if ((z * 3.0) <= 2e+46) {
tmp = 0.3333333333333333 * (((t / y) - 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+83)) then
tmp = x - (y / (z * 3.0d0))
else if ((z * 3.0d0) <= 2d+46) then
tmp = 0.3333333333333333d0 * (((t / y) - 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+83) {
tmp = x - (y / (z * 3.0));
} else if ((z * 3.0) <= 2e+46) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else {
tmp = x + (y * (-0.3333333333333333 / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -5e+83: tmp = x - (y / (z * 3.0)) elif (z * 3.0) <= 2e+46: tmp = 0.3333333333333333 * (((t / y) - 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+83) tmp = Float64(x - Float64(y / Float64(z * 3.0))); elseif (Float64(z * 3.0) <= 2e+46) tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - 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+83) tmp = x - (y / (z * 3.0)); elseif ((z * 3.0) <= 2e+46) tmp = 0.3333333333333333 * (((t / y) - 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+83], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * 3.0), $MachinePrecision], 2e+46], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $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^{+83}:\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{elif}\;z \cdot 3 \leq 2 \cdot 10^{+46}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -5.00000000000000029e83Initial program 99.8%
Taylor expanded in t around 0 84.6%
metadata-eval84.6%
times-frac84.6%
*-un-lft-identity84.6%
*-commutative84.6%
Applied egg-rr84.6%
if -5.00000000000000029e83 < (*.f64 z #s(literal 3 binary64)) < 2e46Initial program 93.4%
Taylor expanded in z around 0 90.1%
Taylor expanded in t around 0 86.2%
+-commutative86.2%
*-commutative86.2%
metadata-eval86.2%
cancel-sign-sub-inv86.2%
distribute-lft-out--86.2%
*-commutative86.2%
associate-/r*88.6%
div-sub89.7%
Simplified89.7%
if 2e46 < (*.f64 z #s(literal 3 binary64)) Initial program 99.7%
sub-neg99.7%
associate-+l+99.7%
+-commutative99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
sub-neg99.7%
neg-mul-199.7%
times-frac89.4%
distribute-frac-neg89.4%
neg-mul-189.4%
*-commutative89.4%
associate-/l*89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in t around 0 81.1%
metadata-eval81.1%
distribute-lft-neg-in81.1%
*-commutative81.1%
associate-*l/81.1%
associate-*r/81.1%
distribute-rgt-neg-out81.1%
distribute-neg-frac81.1%
metadata-eval81.1%
Simplified81.1%
Final simplification87.7%
(FPCore (x y z t)
:precision binary64
(if (<= (* z 3.0) -2e+59)
(+ x (* 0.3333333333333333 (/ t (* z y))))
(if (<= (* z 3.0) 0.2)
(* 0.3333333333333333 (/ (- (/ t y) y) z))
(+ x (* t (/ (/ 0.3333333333333333 z) y))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * 3.0) <= -2e+59) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else if ((z * 3.0) <= 0.2) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else {
tmp = x + (t * ((0.3333333333333333 / z) / 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 ((z * 3.0d0) <= (-2d+59)) then
tmp = x + (0.3333333333333333d0 * (t / (z * y)))
else if ((z * 3.0d0) <= 0.2d0) then
tmp = 0.3333333333333333d0 * (((t / y) - y) / z)
else
tmp = x + (t * ((0.3333333333333333d0 / z) / y))
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+59) {
tmp = x + (0.3333333333333333 * (t / (z * y)));
} else if ((z * 3.0) <= 0.2) {
tmp = 0.3333333333333333 * (((t / y) - y) / z);
} else {
tmp = x + (t * ((0.3333333333333333 / z) / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * 3.0) <= -2e+59: tmp = x + (0.3333333333333333 * (t / (z * y))) elif (z * 3.0) <= 0.2: tmp = 0.3333333333333333 * (((t / y) - y) / z) else: tmp = x + (t * ((0.3333333333333333 / z) / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * 3.0) <= -2e+59) tmp = Float64(x + Float64(0.3333333333333333 * Float64(t / Float64(z * y)))); elseif (Float64(z * 3.0) <= 0.2) tmp = Float64(0.3333333333333333 * Float64(Float64(Float64(t / y) - y) / z)); else tmp = Float64(x + Float64(t * Float64(Float64(0.3333333333333333 / z) / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * 3.0) <= -2e+59) tmp = x + (0.3333333333333333 * (t / (z * y))); elseif ((z * 3.0) <= 0.2) tmp = 0.3333333333333333 * (((t / y) - y) / z); else tmp = x + (t * ((0.3333333333333333 / z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * 3.0), $MachinePrecision], -2e+59], N[(x + N[(0.3333333333333333 * N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * 3.0), $MachinePrecision], 0.2], N[(0.3333333333333333 * N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(N[(0.3333333333333333 / z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot 3 \leq -2 \cdot 10^{+59}:\\
\;\;\;\;x + 0.3333333333333333 \cdot \frac{t}{z \cdot y}\\
\mathbf{elif}\;z \cdot 3 \leq 0.2:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\frac{t}{y} - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{\frac{0.3333333333333333}{z}}{y}\\
\end{array}
\end{array}
if (*.f64 z #s(literal 3 binary64)) < -1.99999999999999994e59Initial program 99.8%
sub-neg99.8%
associate-+l+99.8%
+-commutative99.8%
remove-double-neg99.8%
distribute-frac-neg99.8%
distribute-neg-in99.8%
remove-double-neg99.8%
sub-neg99.8%
neg-mul-199.8%
times-frac87.2%
distribute-frac-neg87.2%
neg-mul-187.2%
*-commutative87.2%
associate-/l*87.2%
*-commutative87.2%
Simplified87.1%
Taylor expanded in t around inf 84.0%
if -1.99999999999999994e59 < (*.f64 z #s(literal 3 binary64)) < 0.20000000000000001Initial program 92.7%
Taylor expanded in z around 0 93.3%
Taylor expanded in t around 0 87.7%
+-commutative87.7%
*-commutative87.7%
metadata-eval87.7%
cancel-sign-sub-inv87.7%
distribute-lft-out--87.7%
*-commutative87.7%
associate-/r*91.5%
div-sub92.8%
Simplified92.8%
if 0.20000000000000001 < (*.f64 z #s(literal 3 binary64)) Initial program 99.7%
sub-neg99.7%
associate-+l+99.7%
+-commutative99.7%
remove-double-neg99.7%
distribute-frac-neg99.7%
distribute-neg-in99.7%
remove-double-neg99.7%
sub-neg99.7%
neg-mul-199.7%
times-frac89.6%
distribute-frac-neg89.6%
neg-mul-189.6%
*-commutative89.6%
associate-/l*89.6%
*-commutative89.6%
Simplified89.6%
*-commutative89.6%
clear-num89.6%
div-inv89.6%
metadata-eval89.6%
un-div-inv89.6%
Applied egg-rr89.6%
Taylor expanded in t around inf 85.0%
associate-*r/85.0%
*-commutative85.0%
times-frac74.9%
associate-*l/83.2%
associate-/l*85.1%
Simplified85.1%
Final simplification89.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ -0.3333333333333333 (/ z y))))
(if (<= y -2.65e+69)
t_1
(if (<= y -1.1e-205)
x
(if (<= y 3.25e-6) (* t (/ (/ 0.3333333333333333 y) z)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = -0.3333333333333333 / (z / y);
double tmp;
if (y <= -2.65e+69) {
tmp = t_1;
} else if (y <= -1.1e-205) {
tmp = x;
} else if (y <= 3.25e-6) {
tmp = t * ((0.3333333333333333 / 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) / (z / y)
if (y <= (-2.65d+69)) then
tmp = t_1
else if (y <= (-1.1d-205)) then
tmp = x
else if (y <= 3.25d-6) then
tmp = t * ((0.3333333333333333d0 / 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 / (z / y);
double tmp;
if (y <= -2.65e+69) {
tmp = t_1;
} else if (y <= -1.1e-205) {
tmp = x;
} else if (y <= 3.25e-6) {
tmp = t * ((0.3333333333333333 / y) / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -0.3333333333333333 / (z / y) tmp = 0 if y <= -2.65e+69: tmp = t_1 elif y <= -1.1e-205: tmp = x elif y <= 3.25e-6: tmp = t * ((0.3333333333333333 / y) / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-0.3333333333333333 / Float64(z / y)) tmp = 0.0 if (y <= -2.65e+69) tmp = t_1; elseif (y <= -1.1e-205) tmp = x; elseif (y <= 3.25e-6) tmp = Float64(t * Float64(Float64(0.3333333333333333 / y) / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -0.3333333333333333 / (z / y); tmp = 0.0; if (y <= -2.65e+69) tmp = t_1; elseif (y <= -1.1e-205) tmp = x; elseif (y <= 3.25e-6) tmp = t * ((0.3333333333333333 / y) / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-0.3333333333333333 / N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.65e+69], t$95$1, If[LessEqual[y, -1.1e-205], x, If[LessEqual[y, 3.25e-6], N[(t * N[(N[(0.3333333333333333 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{-0.3333333333333333}{\frac{z}{y}}\\
\mathbf{if}\;y \leq -2.65 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{-205}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.25 \cdot 10^{-6}:\\
\;\;\;\;t \cdot \frac{\frac{0.3333333333333333}{y}}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.65e69 or 3.2499999999999998e-6 < y Initial program 98.2%
Taylor expanded in z around 0 79.9%
Taylor expanded in t around 0 71.6%
clear-num71.6%
un-div-inv71.7%
Applied egg-rr71.7%
if -2.65e69 < y < -1.10000000000000005e-205Initial program 90.5%
+-commutative90.5%
associate-+r-90.5%
sub-neg90.5%
associate-*l*90.5%
*-commutative90.5%
distribute-frac-neg290.5%
distribute-rgt-neg-in90.5%
metadata-eval90.5%
Simplified90.5%
Taylor expanded in z around inf 46.9%
if -1.10000000000000005e-205 < y < 3.2499999999999998e-6Initial program 94.4%
Taylor expanded in z around 0 66.9%
Taylor expanded in t around inf 66.7%
associate-*r/66.6%
*-commutative66.6%
associate-*r/66.7%
associate-/r*66.7%
Simplified66.7%
Final simplification65.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.1e-205) (not (<= y 1.35e-93))) (+ x (* y (/ -0.3333333333333333 z))) (* t (/ (/ 0.3333333333333333 y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.1e-205) || !(y <= 1.35e-93)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = t * ((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 ((y <= (-1.1d-205)) .or. (.not. (y <= 1.35d-93))) then
tmp = x + (y * ((-0.3333333333333333d0) / z))
else
tmp = t * ((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 ((y <= -1.1e-205) || !(y <= 1.35e-93)) {
tmp = x + (y * (-0.3333333333333333 / z));
} else {
tmp = t * ((0.3333333333333333 / y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.1e-205) or not (y <= 1.35e-93): tmp = x + (y * (-0.3333333333333333 / z)) else: tmp = t * ((0.3333333333333333 / y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.1e-205) || !(y <= 1.35e-93)) tmp = Float64(x + Float64(y * Float64(-0.3333333333333333 / z))); else tmp = Float64(t * Float64(Float64(0.3333333333333333 / y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.1e-205) || ~((y <= 1.35e-93))) tmp = x + (y * (-0.3333333333333333 / z)); else tmp = t * ((0.3333333333333333 / y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.1e-205], N[Not[LessEqual[y, 1.35e-93]], $MachinePrecision]], N[(x + N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(0.3333333333333333 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-205} \lor \neg \left(y \leq 1.35 \cdot 10^{-93}\right):\\
\;\;\;\;x + y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\frac{0.3333333333333333}{y}}{z}\\
\end{array}
\end{array}
if y < -1.10000000000000005e-205 or 1.3500000000000001e-93 < y Initial program 96.3%
sub-neg96.3%
associate-+l+96.3%
+-commutative96.3%
remove-double-neg96.3%
distribute-frac-neg96.3%
distribute-neg-in96.3%
remove-double-neg96.3%
sub-neg96.3%
neg-mul-196.3%
times-frac97.8%
distribute-frac-neg97.8%
neg-mul-197.8%
*-commutative97.8%
associate-/l*97.8%
*-commutative97.8%
Simplified98.8%
Taylor expanded in t around 0 81.6%
metadata-eval81.6%
distribute-lft-neg-in81.6%
*-commutative81.6%
associate-*l/81.6%
associate-*r/81.6%
distribute-rgt-neg-out81.6%
distribute-neg-frac81.6%
metadata-eval81.6%
Simplified81.6%
if -1.10000000000000005e-205 < y < 1.3500000000000001e-93Initial program 92.8%
Taylor expanded in z around 0 68.4%
Taylor expanded in t around inf 72.7%
associate-*r/72.5%
*-commutative72.5%
associate-*r/72.6%
associate-/r*72.7%
Simplified72.7%
Final simplification79.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.1e-205) (not (<= y 1.28e-92))) (- x (/ y (* z 3.0))) (* t (/ (/ 0.3333333333333333 y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.1e-205) || !(y <= 1.28e-92)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = t * ((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 ((y <= (-1.1d-205)) .or. (.not. (y <= 1.28d-92))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = t * ((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 ((y <= -1.1e-205) || !(y <= 1.28e-92)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = t * ((0.3333333333333333 / y) / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.1e-205) or not (y <= 1.28e-92): tmp = x - (y / (z * 3.0)) else: tmp = t * ((0.3333333333333333 / y) / z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.1e-205) || !(y <= 1.28e-92)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = Float64(t * Float64(Float64(0.3333333333333333 / y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.1e-205) || ~((y <= 1.28e-92))) tmp = x - (y / (z * 3.0)); else tmp = t * ((0.3333333333333333 / y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.1e-205], N[Not[LessEqual[y, 1.28e-92]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(0.3333333333333333 / y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{-205} \lor \neg \left(y \leq 1.28 \cdot 10^{-92}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{\frac{0.3333333333333333}{y}}{z}\\
\end{array}
\end{array}
if y < -1.10000000000000005e-205 or 1.2799999999999999e-92 < y Initial program 96.3%
Taylor expanded in t around 0 81.6%
metadata-eval81.6%
times-frac81.7%
*-un-lft-identity81.7%
*-commutative81.7%
Applied egg-rr81.7%
if -1.10000000000000005e-205 < y < 1.2799999999999999e-92Initial program 92.8%
Taylor expanded in z around 0 68.4%
Taylor expanded in t around inf 72.7%
associate-*r/72.5%
*-commutative72.5%
associate-*r/72.6%
associate-/r*72.7%
Simplified72.7%
Final simplification79.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2.65e-109) (not (<= y 6.2e-93))) (- x (/ y (* z 3.0))) (/ (* 0.3333333333333333 (/ t z)) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.65e-109) || !(y <= 6.2e-93)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = (0.3333333333333333 * (t / z)) / 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 <= (-2.65d-109)) .or. (.not. (y <= 6.2d-93))) then
tmp = x - (y / (z * 3.0d0))
else
tmp = (0.3333333333333333d0 * (t / z)) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2.65e-109) || !(y <= 6.2e-93)) {
tmp = x - (y / (z * 3.0));
} else {
tmp = (0.3333333333333333 * (t / z)) / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2.65e-109) or not (y <= 6.2e-93): tmp = x - (y / (z * 3.0)) else: tmp = (0.3333333333333333 * (t / z)) / y return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2.65e-109) || !(y <= 6.2e-93)) tmp = Float64(x - Float64(y / Float64(z * 3.0))); else tmp = Float64(Float64(0.3333333333333333 * Float64(t / z)) / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -2.65e-109) || ~((y <= 6.2e-93))) tmp = x - (y / (z * 3.0)); else tmp = (0.3333333333333333 * (t / z)) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.65e-109], N[Not[LessEqual[y, 6.2e-93]], $MachinePrecision]], N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 * N[(t / z), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.65 \cdot 10^{-109} \lor \neg \left(y \leq 6.2 \cdot 10^{-93}\right):\\
\;\;\;\;x - \frac{y}{z \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \frac{t}{z}}{y}\\
\end{array}
\end{array}
if y < -2.6499999999999999e-109 or 6.19999999999999999e-93 < y Initial program 97.2%
Taylor expanded in t around 0 83.7%
metadata-eval83.7%
times-frac83.8%
*-un-lft-identity83.8%
*-commutative83.8%
Applied egg-rr83.8%
if -2.6499999999999999e-109 < y < 6.19999999999999999e-93Initial program 91.2%
+-commutative91.2%
associate-+r-91.2%
sub-neg91.2%
associate-*l*91.3%
*-commutative91.3%
distribute-frac-neg291.3%
distribute-rgt-neg-in91.3%
metadata-eval91.3%
Simplified91.3%
Taylor expanded in y around 0 94.2%
Taylor expanded in t around inf 72.0%
Final simplification80.3%
(FPCore (x y z t) :precision binary64 (if (<= z -6.4e+42) x (if (<= z 0.28) (* -0.3333333333333333 (/ y z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.4e+42) {
tmp = x;
} else if (z <= 0.28) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-6.4d+42)) then
tmp = x
else if (z <= 0.28d0) then
tmp = (-0.3333333333333333d0) * (y / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.4e+42) {
tmp = x;
} else if (z <= 0.28) {
tmp = -0.3333333333333333 * (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.4e+42: tmp = x elif z <= 0.28: tmp = -0.3333333333333333 * (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.4e+42) tmp = x; elseif (z <= 0.28) tmp = Float64(-0.3333333333333333 * Float64(y / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.4e+42) tmp = x; elseif (z <= 0.28) tmp = -0.3333333333333333 * (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.4e+42], x, If[LessEqual[z, 0.28], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+42}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 0.28:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.40000000000000004e42 or 0.28000000000000003 < z Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
sub-neg99.8%
associate-*l*99.8%
*-commutative99.8%
distribute-frac-neg299.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 58.4%
if -6.40000000000000004e42 < z < 0.28000000000000003Initial program 92.5%
Taylor expanded in z around 0 93.2%
Taylor expanded in t around 0 55.7%
Final simplification56.7%
(FPCore (x y z t) :precision binary64 (if (<= z -5.2e+47) x (if (<= z 0.6) (* y (/ -0.3333333333333333 z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+47) {
tmp = x;
} else if (z <= 0.6) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5.2d+47)) then
tmp = x
else if (z <= 0.6d0) then
tmp = y * ((-0.3333333333333333d0) / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.2e+47) {
tmp = x;
} else if (z <= 0.6) {
tmp = y * (-0.3333333333333333 / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.2e+47: tmp = x elif z <= 0.6: tmp = y * (-0.3333333333333333 / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.2e+47) tmp = x; elseif (z <= 0.6) tmp = Float64(y * Float64(-0.3333333333333333 / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.2e+47) tmp = x; elseif (z <= 0.6) tmp = y * (-0.3333333333333333 / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.2e+47], x, If[LessEqual[z, 0.6], N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+47}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;y \cdot \frac{-0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.20000000000000007e47 or 0.599999999999999978 < z Initial program 99.8%
+-commutative99.8%
associate-+r-99.8%
sub-neg99.8%
associate-*l*99.8%
*-commutative99.8%
distribute-frac-neg299.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 58.4%
if -5.20000000000000007e47 < z < 0.599999999999999978Initial program 92.5%
Taylor expanded in z around 0 93.2%
Taylor expanded in t around 0 87.5%
+-commutative87.5%
*-commutative87.5%
metadata-eval87.5%
cancel-sign-sub-inv87.5%
distribute-lft-out--87.5%
*-commutative87.5%
associate-/r*91.4%
div-sub92.7%
Simplified92.7%
Taylor expanded in t around 0 55.7%
*-commutative55.7%
associate-*l/55.7%
associate-*r/55.7%
Simplified55.7%
Final simplification56.7%
(FPCore (x y z t) :precision binary64 (+ x (* (- (/ t y) y) (/ 0.3333333333333333 z))))
double code(double x, double y, double z, double t) {
return x + (((t / y) - y) * (0.3333333333333333 / z));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (((t / y) - y) * (0.3333333333333333d0 / z))
end function
public static double code(double x, double y, double z, double t) {
return x + (((t / y) - y) * (0.3333333333333333 / z));
}
def code(x, y, z, t): return x + (((t / y) - y) * (0.3333333333333333 / z))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(t / y) - y) * Float64(0.3333333333333333 / z))) end
function tmp = code(x, y, z, t) tmp = x + (((t / y) - y) * (0.3333333333333333 / z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] * N[(0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\frac{t}{y} - y\right) \cdot \frac{0.3333333333333333}{z}
\end{array}
Initial program 95.4%
sub-neg95.4%
associate-+l+95.4%
+-commutative95.4%
remove-double-neg95.4%
distribute-frac-neg95.4%
distribute-neg-in95.4%
remove-double-neg95.4%
sub-neg95.4%
neg-mul-195.4%
times-frac94.3%
distribute-frac-neg94.3%
neg-mul-194.3%
*-commutative94.3%
associate-/l*94.3%
*-commutative94.3%
Simplified95.0%
Final simplification95.0%
(FPCore (x y z t) :precision binary64 (+ x (/ (- (/ t y) y) (* z 3.0))))
double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x + (((t / y) - y) / (z * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return x + (((t / y) - y) / (z * 3.0));
}
def code(x, y, z, t): return x + (((t / y) - y) / (z * 3.0))
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(t / y) - y) / Float64(z * 3.0))) end
function tmp = code(x, y, z, t) tmp = x + (((t / y) - y) / (z * 3.0)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\frac{t}{y} - y}{z \cdot 3}
\end{array}
Initial program 95.4%
sub-neg95.4%
associate-+l+95.4%
+-commutative95.4%
remove-double-neg95.4%
distribute-frac-neg95.4%
distribute-neg-in95.4%
remove-double-neg95.4%
sub-neg95.4%
neg-mul-195.4%
times-frac94.3%
distribute-frac-neg94.3%
neg-mul-194.3%
*-commutative94.3%
associate-/l*94.3%
*-commutative94.3%
Simplified95.0%
*-commutative95.0%
clear-num95.1%
div-inv95.1%
metadata-eval95.1%
un-div-inv95.1%
Applied egg-rr95.1%
Final simplification95.1%
(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.4%
+-commutative95.4%
associate-+r-95.4%
sub-neg95.4%
associate-*l*95.4%
*-commutative95.4%
distribute-frac-neg295.4%
distribute-rgt-neg-in95.4%
metadata-eval95.4%
Simplified95.4%
Taylor expanded in z around inf 28.1%
Final simplification28.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 2024082
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))