
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x - ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x - ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y \cdot \left(z - t\right)}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x - ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x - ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (- t z) (/ a y))))
double code(double x, double y, double z, double t, double a) {
return x + ((t - z) / (a / y));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((t - z) / (a / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((t - z) / (a / y));
}
def code(x, y, z, t, a): return x + ((t - z) / (a / y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(t - z) / Float64(a / y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((t - z) / (a / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{t - z}{\frac{a}{y}}
\end{array}
Initial program 91.8%
*-commutative91.8%
associate-/l*97.2%
Applied egg-rr97.2%
clear-num97.2%
un-div-inv97.3%
Applied egg-rr97.3%
Final simplification97.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ t (/ a y))))
(if (<= z -3.1e+79)
(* (/ y a) (- z))
(if (<= z -9.4e-67)
t_1
(if (<= z -1.75e-184)
x
(if (<= z -3e-196)
(* y (/ t a))
(if (<= z 1.3e-108)
x
(if (<= z 5.2e-55)
t_1
(if (<= z 1.65e-53)
x
(if (<= z 9e-11)
(/ y (/ a t))
(if (<= z 7e+31) x (/ z (/ a (- y))))))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a / y);
double tmp;
if (z <= -3.1e+79) {
tmp = (y / a) * -z;
} else if (z <= -9.4e-67) {
tmp = t_1;
} else if (z <= -1.75e-184) {
tmp = x;
} else if (z <= -3e-196) {
tmp = y * (t / a);
} else if (z <= 1.3e-108) {
tmp = x;
} else if (z <= 5.2e-55) {
tmp = t_1;
} else if (z <= 1.65e-53) {
tmp = x;
} else if (z <= 9e-11) {
tmp = y / (a / t);
} else if (z <= 7e+31) {
tmp = x;
} else {
tmp = z / (a / -y);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = t / (a / y)
if (z <= (-3.1d+79)) then
tmp = (y / a) * -z
else if (z <= (-9.4d-67)) then
tmp = t_1
else if (z <= (-1.75d-184)) then
tmp = x
else if (z <= (-3d-196)) then
tmp = y * (t / a)
else if (z <= 1.3d-108) then
tmp = x
else if (z <= 5.2d-55) then
tmp = t_1
else if (z <= 1.65d-53) then
tmp = x
else if (z <= 9d-11) then
tmp = y / (a / t)
else if (z <= 7d+31) then
tmp = x
else
tmp = z / (a / -y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a / y);
double tmp;
if (z <= -3.1e+79) {
tmp = (y / a) * -z;
} else if (z <= -9.4e-67) {
tmp = t_1;
} else if (z <= -1.75e-184) {
tmp = x;
} else if (z <= -3e-196) {
tmp = y * (t / a);
} else if (z <= 1.3e-108) {
tmp = x;
} else if (z <= 5.2e-55) {
tmp = t_1;
} else if (z <= 1.65e-53) {
tmp = x;
} else if (z <= 9e-11) {
tmp = y / (a / t);
} else if (z <= 7e+31) {
tmp = x;
} else {
tmp = z / (a / -y);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t / (a / y) tmp = 0 if z <= -3.1e+79: tmp = (y / a) * -z elif z <= -9.4e-67: tmp = t_1 elif z <= -1.75e-184: tmp = x elif z <= -3e-196: tmp = y * (t / a) elif z <= 1.3e-108: tmp = x elif z <= 5.2e-55: tmp = t_1 elif z <= 1.65e-53: tmp = x elif z <= 9e-11: tmp = y / (a / t) elif z <= 7e+31: tmp = x else: tmp = z / (a / -y) return tmp
function code(x, y, z, t, a) t_1 = Float64(t / Float64(a / y)) tmp = 0.0 if (z <= -3.1e+79) tmp = Float64(Float64(y / a) * Float64(-z)); elseif (z <= -9.4e-67) tmp = t_1; elseif (z <= -1.75e-184) tmp = x; elseif (z <= -3e-196) tmp = Float64(y * Float64(t / a)); elseif (z <= 1.3e-108) tmp = x; elseif (z <= 5.2e-55) tmp = t_1; elseif (z <= 1.65e-53) tmp = x; elseif (z <= 9e-11) tmp = Float64(y / Float64(a / t)); elseif (z <= 7e+31) tmp = x; else tmp = Float64(z / Float64(a / Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t / (a / y); tmp = 0.0; if (z <= -3.1e+79) tmp = (y / a) * -z; elseif (z <= -9.4e-67) tmp = t_1; elseif (z <= -1.75e-184) tmp = x; elseif (z <= -3e-196) tmp = y * (t / a); elseif (z <= 1.3e-108) tmp = x; elseif (z <= 5.2e-55) tmp = t_1; elseif (z <= 1.65e-53) tmp = x; elseif (z <= 9e-11) tmp = y / (a / t); elseif (z <= 7e+31) tmp = x; else tmp = z / (a / -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+79], N[(N[(y / a), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[z, -9.4e-67], t$95$1, If[LessEqual[z, -1.75e-184], x, If[LessEqual[z, -3e-196], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.3e-108], x, If[LessEqual[z, 5.2e-55], t$95$1, If[LessEqual[z, 1.65e-53], x, If[LessEqual[z, 9e-11], N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+31], x, N[(z / N[(a / (-y)), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{\frac{a}{y}}\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+79}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\
\mathbf{elif}\;z \leq -9.4 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-184}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-196}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-108}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-53}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-11}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+31}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{a}{-y}}\\
\end{array}
\end{array}
if z < -3.0999999999999999e79Initial program 89.0%
*-commutative89.0%
associate-/l*95.9%
Applied egg-rr95.9%
Taylor expanded in z around inf 63.0%
mul-1-neg63.0%
distribute-neg-frac263.0%
*-commutative63.0%
associate-*r/73.7%
Simplified73.7%
if -3.0999999999999999e79 < z < -9.40000000000000009e-67 or 1.29999999999999992e-108 < z < 5.1999999999999998e-55Initial program 88.0%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in t around inf 42.6%
*-commutative42.6%
Simplified42.6%
associate-/l*49.8%
*-commutative49.8%
Applied egg-rr49.8%
associate-/r/57.0%
Applied egg-rr57.0%
if -9.40000000000000009e-67 < z < -1.74999999999999991e-184 or -3e-196 < z < 1.29999999999999992e-108 or 5.1999999999999998e-55 < z < 1.65000000000000002e-53 or 8.9999999999999999e-11 < z < 7e31Initial program 96.2%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in x around inf 60.8%
if -1.74999999999999991e-184 < z < -3e-196Initial program 81.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 61.6%
*-commutative61.6%
associate-/l*80.6%
Simplified80.6%
if 1.65000000000000002e-53 < z < 8.9999999999999999e-11Initial program 89.7%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in t around inf 44.6%
*-commutative44.6%
Simplified44.6%
associate-/l*54.5%
*-commutative54.5%
Applied egg-rr54.5%
*-commutative54.5%
clear-num54.5%
un-div-inv54.7%
Applied egg-rr54.7%
if 7e31 < z Initial program 89.8%
*-commutative89.8%
associate-/l*99.7%
Applied egg-rr99.7%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 62.1%
mul-1-neg62.1%
associate-*r/62.3%
*-commutative62.3%
associate-*l/62.1%
associate-*r/68.0%
distribute-lft-neg-in68.0%
Simplified68.0%
clear-num68.1%
un-div-inv68.2%
add-sqr-sqrt0.0%
sqrt-unprod3.3%
sqr-neg3.3%
sqrt-unprod3.4%
add-sqr-sqrt3.4%
frac-2neg3.4%
add-sqr-sqrt0.0%
sqrt-unprod44.9%
sqr-neg44.9%
sqrt-unprod68.0%
add-sqr-sqrt68.2%
distribute-neg-frac268.2%
Applied egg-rr68.2%
Final simplification64.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ t (/ a y))) (t_2 (* (/ y a) (- z))))
(if (<= z -3.1e+79)
t_2
(if (<= z -4.7e-67)
t_1
(if (<= z -1.8e-185)
x
(if (<= z -5.9e-198)
(* y (/ t a))
(if (<= z 4.3e-108)
x
(if (<= z 5.4e-55)
t_1
(if (<= z 5e-53)
x
(if (<= z 1.45e-8)
(/ y (/ a t))
(if (<= z 5.5e+20) x t_2)))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a / y);
double t_2 = (y / a) * -z;
double tmp;
if (z <= -3.1e+79) {
tmp = t_2;
} else if (z <= -4.7e-67) {
tmp = t_1;
} else if (z <= -1.8e-185) {
tmp = x;
} else if (z <= -5.9e-198) {
tmp = y * (t / a);
} else if (z <= 4.3e-108) {
tmp = x;
} else if (z <= 5.4e-55) {
tmp = t_1;
} else if (z <= 5e-53) {
tmp = x;
} else if (z <= 1.45e-8) {
tmp = y / (a / t);
} else if (z <= 5.5e+20) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t / (a / y)
t_2 = (y / a) * -z
if (z <= (-3.1d+79)) then
tmp = t_2
else if (z <= (-4.7d-67)) then
tmp = t_1
else if (z <= (-1.8d-185)) then
tmp = x
else if (z <= (-5.9d-198)) then
tmp = y * (t / a)
else if (z <= 4.3d-108) then
tmp = x
else if (z <= 5.4d-55) then
tmp = t_1
else if (z <= 5d-53) then
tmp = x
else if (z <= 1.45d-8) then
tmp = y / (a / t)
else if (z <= 5.5d+20) then
tmp = x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a / y);
double t_2 = (y / a) * -z;
double tmp;
if (z <= -3.1e+79) {
tmp = t_2;
} else if (z <= -4.7e-67) {
tmp = t_1;
} else if (z <= -1.8e-185) {
tmp = x;
} else if (z <= -5.9e-198) {
tmp = y * (t / a);
} else if (z <= 4.3e-108) {
tmp = x;
} else if (z <= 5.4e-55) {
tmp = t_1;
} else if (z <= 5e-53) {
tmp = x;
} else if (z <= 1.45e-8) {
tmp = y / (a / t);
} else if (z <= 5.5e+20) {
tmp = x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t / (a / y) t_2 = (y / a) * -z tmp = 0 if z <= -3.1e+79: tmp = t_2 elif z <= -4.7e-67: tmp = t_1 elif z <= -1.8e-185: tmp = x elif z <= -5.9e-198: tmp = y * (t / a) elif z <= 4.3e-108: tmp = x elif z <= 5.4e-55: tmp = t_1 elif z <= 5e-53: tmp = x elif z <= 1.45e-8: tmp = y / (a / t) elif z <= 5.5e+20: tmp = x else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t / Float64(a / y)) t_2 = Float64(Float64(y / a) * Float64(-z)) tmp = 0.0 if (z <= -3.1e+79) tmp = t_2; elseif (z <= -4.7e-67) tmp = t_1; elseif (z <= -1.8e-185) tmp = x; elseif (z <= -5.9e-198) tmp = Float64(y * Float64(t / a)); elseif (z <= 4.3e-108) tmp = x; elseif (z <= 5.4e-55) tmp = t_1; elseif (z <= 5e-53) tmp = x; elseif (z <= 1.45e-8) tmp = Float64(y / Float64(a / t)); elseif (z <= 5.5e+20) tmp = x; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t / (a / y); t_2 = (y / a) * -z; tmp = 0.0; if (z <= -3.1e+79) tmp = t_2; elseif (z <= -4.7e-67) tmp = t_1; elseif (z <= -1.8e-185) tmp = x; elseif (z <= -5.9e-198) tmp = y * (t / a); elseif (z <= 4.3e-108) tmp = x; elseif (z <= 5.4e-55) tmp = t_1; elseif (z <= 5e-53) tmp = x; elseif (z <= 1.45e-8) tmp = y / (a / t); elseif (z <= 5.5e+20) tmp = x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] * (-z)), $MachinePrecision]}, If[LessEqual[z, -3.1e+79], t$95$2, If[LessEqual[z, -4.7e-67], t$95$1, If[LessEqual[z, -1.8e-185], x, If[LessEqual[z, -5.9e-198], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e-108], x, If[LessEqual[z, 5.4e-55], t$95$1, If[LessEqual[z, 5e-53], x, If[LessEqual[z, 1.45e-8], N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e+20], x, t$95$2]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{\frac{a}{y}}\\
t_2 := \frac{y}{a} \cdot \left(-z\right)\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+79}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-185}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -5.9 \cdot 10^{-198}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{-108}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-53}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-8}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+20}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -3.0999999999999999e79 or 5.5e20 < z Initial program 89.4%
*-commutative89.4%
associate-/l*97.8%
Applied egg-rr97.8%
Taylor expanded in z around inf 62.6%
mul-1-neg62.6%
distribute-neg-frac262.6%
*-commutative62.6%
associate-*r/71.0%
Simplified71.0%
if -3.0999999999999999e79 < z < -4.70000000000000004e-67 or 4.3e-108 < z < 5.40000000000000008e-55Initial program 88.0%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in t around inf 42.6%
*-commutative42.6%
Simplified42.6%
associate-/l*49.8%
*-commutative49.8%
Applied egg-rr49.8%
associate-/r/57.0%
Applied egg-rr57.0%
if -4.70000000000000004e-67 < z < -1.7999999999999999e-185 or -5.89999999999999974e-198 < z < 4.3e-108 or 5.40000000000000008e-55 < z < 5e-53 or 1.4500000000000001e-8 < z < 5.5e20Initial program 96.2%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in x around inf 60.8%
if -1.7999999999999999e-185 < z < -5.89999999999999974e-198Initial program 81.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 61.6%
*-commutative61.6%
associate-/l*80.6%
Simplified80.6%
if 5e-53 < z < 1.4500000000000001e-8Initial program 89.7%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in t around inf 44.6%
*-commutative44.6%
Simplified44.6%
associate-/l*54.5%
*-commutative54.5%
Applied egg-rr54.5%
*-commutative54.5%
clear-num54.5%
un-div-inv54.7%
Applied egg-rr54.7%
Final simplification64.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ y a))) (t_2 (* y (/ z (- a)))))
(if (<= y -4.75e+58)
t_2
(if (<= y -4.5e-21)
t_1
(if (<= y 380.0)
x
(if (<= y 2.8e+49)
(* y (/ t a))
(if (<= y 3.2e+161)
t_2
(if (<= y 7.8e+191)
(/ t (/ a y))
(if (<= y 8e+191) x (if (<= y 5.8e+226) t_2 t_1))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / a);
double t_2 = y * (z / -a);
double tmp;
if (y <= -4.75e+58) {
tmp = t_2;
} else if (y <= -4.5e-21) {
tmp = t_1;
} else if (y <= 380.0) {
tmp = x;
} else if (y <= 2.8e+49) {
tmp = y * (t / a);
} else if (y <= 3.2e+161) {
tmp = t_2;
} else if (y <= 7.8e+191) {
tmp = t / (a / y);
} else if (y <= 8e+191) {
tmp = x;
} else if (y <= 5.8e+226) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t * (y / a)
t_2 = y * (z / -a)
if (y <= (-4.75d+58)) then
tmp = t_2
else if (y <= (-4.5d-21)) then
tmp = t_1
else if (y <= 380.0d0) then
tmp = x
else if (y <= 2.8d+49) then
tmp = y * (t / a)
else if (y <= 3.2d+161) then
tmp = t_2
else if (y <= 7.8d+191) then
tmp = t / (a / y)
else if (y <= 8d+191) then
tmp = x
else if (y <= 5.8d+226) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / a);
double t_2 = y * (z / -a);
double tmp;
if (y <= -4.75e+58) {
tmp = t_2;
} else if (y <= -4.5e-21) {
tmp = t_1;
} else if (y <= 380.0) {
tmp = x;
} else if (y <= 2.8e+49) {
tmp = y * (t / a);
} else if (y <= 3.2e+161) {
tmp = t_2;
} else if (y <= 7.8e+191) {
tmp = t / (a / y);
} else if (y <= 8e+191) {
tmp = x;
} else if (y <= 5.8e+226) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / a) t_2 = y * (z / -a) tmp = 0 if y <= -4.75e+58: tmp = t_2 elif y <= -4.5e-21: tmp = t_1 elif y <= 380.0: tmp = x elif y <= 2.8e+49: tmp = y * (t / a) elif y <= 3.2e+161: tmp = t_2 elif y <= 7.8e+191: tmp = t / (a / y) elif y <= 8e+191: tmp = x elif y <= 5.8e+226: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / a)) t_2 = Float64(y * Float64(z / Float64(-a))) tmp = 0.0 if (y <= -4.75e+58) tmp = t_2; elseif (y <= -4.5e-21) tmp = t_1; elseif (y <= 380.0) tmp = x; elseif (y <= 2.8e+49) tmp = Float64(y * Float64(t / a)); elseif (y <= 3.2e+161) tmp = t_2; elseif (y <= 7.8e+191) tmp = Float64(t / Float64(a / y)); elseif (y <= 8e+191) tmp = x; elseif (y <= 5.8e+226) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y / a); t_2 = y * (z / -a); tmp = 0.0; if (y <= -4.75e+58) tmp = t_2; elseif (y <= -4.5e-21) tmp = t_1; elseif (y <= 380.0) tmp = x; elseif (y <= 2.8e+49) tmp = y * (t / a); elseif (y <= 3.2e+161) tmp = t_2; elseif (y <= 7.8e+191) tmp = t / (a / y); elseif (y <= 8e+191) tmp = x; elseif (y <= 5.8e+226) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.75e+58], t$95$2, If[LessEqual[y, -4.5e-21], t$95$1, If[LessEqual[y, 380.0], x, If[LessEqual[y, 2.8e+49], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e+161], t$95$2, If[LessEqual[y, 7.8e+191], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+191], x, If[LessEqual[y, 5.8e+226], t$95$2, t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a}\\
t_2 := y \cdot \frac{z}{-a}\\
\mathbf{if}\;y \leq -4.75 \cdot 10^{+58}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 380:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+49}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+161}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+191}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+191}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+226}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.7500000000000001e58 or 2.7999999999999998e49 < y < 3.20000000000000002e161 or 8.00000000000000058e191 < y < 5.79999999999999949e226Initial program 85.7%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around inf 52.7%
mul-1-neg52.7%
associate-/l*59.1%
distribute-rgt-neg-in59.1%
distribute-neg-frac259.1%
Simplified59.1%
if -4.7500000000000001e58 < y < -4.49999999999999968e-21 or 5.79999999999999949e226 < y Initial program 90.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 47.5%
*-commutative47.5%
Simplified47.5%
*-commutative47.5%
associate-/l*57.2%
*-commutative57.2%
Applied egg-rr57.2%
if -4.49999999999999968e-21 < y < 380 or 7.8000000000000001e191 < y < 8.00000000000000058e191Initial program 99.9%
associate-/l*91.6%
Simplified91.6%
Taylor expanded in x around inf 61.2%
if 380 < y < 2.7999999999999998e49Initial program 82.3%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in t around inf 46.4%
*-commutative46.4%
associate-/l*55.3%
Simplified55.3%
if 3.20000000000000002e161 < y < 7.8000000000000001e191Initial program 47.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 46.7%
*-commutative46.7%
Simplified46.7%
associate-/l*67.8%
*-commutative67.8%
Applied egg-rr67.8%
associate-/r/68.0%
Applied egg-rr68.0%
Final simplification60.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1e+173) (not (<= t 1.45e-35))) (+ x (/ (* t y) a)) (- x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1e+173) || !(t <= 1.45e-35)) {
tmp = x + ((t * y) / a);
} else {
tmp = x - ((z * y) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1d+173)) .or. (.not. (t <= 1.45d-35))) then
tmp = x + ((t * y) / a)
else
tmp = x - ((z * y) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1e+173) || !(t <= 1.45e-35)) {
tmp = x + ((t * y) / a);
} else {
tmp = x - ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1e+173) or not (t <= 1.45e-35): tmp = x + ((t * y) / a) else: tmp = x - ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1e+173) || !(t <= 1.45e-35)) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(x - Float64(Float64(z * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1e+173) || ~((t <= 1.45e-35))) tmp = x + ((t * y) / a); else tmp = x - ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1e+173], N[Not[LessEqual[t, 1.45e-35]], $MachinePrecision]], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+173} \lor \neg \left(t \leq 1.45 \cdot 10^{-35}\right):\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if t < -1e173 or 1.4500000000000001e-35 < t Initial program 87.4%
sub-neg87.4%
distribute-frac-neg287.4%
+-commutative87.4%
associate-/l*94.7%
fma-define94.7%
distribute-frac-neg294.7%
distribute-neg-frac94.7%
sub-neg94.7%
distribute-neg-in94.7%
remove-double-neg94.7%
+-commutative94.7%
sub-neg94.7%
Simplified94.7%
Taylor expanded in z around 0 78.7%
if -1e173 < t < 1.4500000000000001e-35Initial program 94.2%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 84.8%
Final simplification82.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.14e+163) (* (/ y a) (- z)) (if (<= z 1.7e+35) (+ x (/ (* t y) a)) (/ z (/ a (- y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.14e+163) {
tmp = (y / a) * -z;
} else if (z <= 1.7e+35) {
tmp = x + ((t * y) / a);
} else {
tmp = z / (a / -y);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.14d+163)) then
tmp = (y / a) * -z
else if (z <= 1.7d+35) then
tmp = x + ((t * y) / a)
else
tmp = z / (a / -y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.14e+163) {
tmp = (y / a) * -z;
} else if (z <= 1.7e+35) {
tmp = x + ((t * y) / a);
} else {
tmp = z / (a / -y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.14e+163: tmp = (y / a) * -z elif z <= 1.7e+35: tmp = x + ((t * y) / a) else: tmp = z / (a / -y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.14e+163) tmp = Float64(Float64(y / a) * Float64(-z)); elseif (z <= 1.7e+35) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(z / Float64(a / Float64(-y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.14e+163) tmp = (y / a) * -z; elseif (z <= 1.7e+35) tmp = x + ((t * y) / a); else tmp = z / (a / -y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.14e+163], N[(N[(y / a), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[z, 1.7e+35], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(z / N[(a / (-y)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.14 \cdot 10^{+163}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+35}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{a}{-y}}\\
\end{array}
\end{array}
if z < -1.13999999999999999e163Initial program 84.1%
*-commutative84.1%
associate-/l*98.3%
Applied egg-rr98.3%
Taylor expanded in z around inf 73.4%
mul-1-neg73.4%
distribute-neg-frac273.4%
*-commutative73.4%
associate-*r/89.0%
Simplified89.0%
if -1.13999999999999999e163 < z < 1.7000000000000001e35Initial program 93.9%
sub-neg93.9%
distribute-frac-neg293.9%
+-commutative93.9%
associate-/l*97.7%
fma-define97.7%
distribute-frac-neg297.7%
distribute-neg-frac97.7%
sub-neg97.7%
distribute-neg-in97.7%
remove-double-neg97.7%
+-commutative97.7%
sub-neg97.7%
Simplified97.7%
Taylor expanded in z around 0 79.9%
if 1.7000000000000001e35 < z Initial program 89.8%
*-commutative89.8%
associate-/l*99.7%
Applied egg-rr99.7%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 62.1%
mul-1-neg62.1%
associate-*r/62.3%
*-commutative62.3%
associate-*l/62.1%
associate-*r/68.0%
distribute-lft-neg-in68.0%
Simplified68.0%
clear-num68.1%
un-div-inv68.2%
add-sqr-sqrt0.0%
sqrt-unprod3.3%
sqr-neg3.3%
sqrt-unprod3.4%
add-sqr-sqrt3.4%
frac-2neg3.4%
add-sqr-sqrt0.0%
sqrt-unprod44.9%
sqr-neg44.9%
sqrt-unprod68.0%
add-sqr-sqrt68.2%
distribute-neg-frac268.2%
Applied egg-rr68.2%
Final simplification78.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -175000000000.0) (not (<= y 88000.0))) (* y (/ t a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -175000000000.0) || !(y <= 88000.0)) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-175000000000.0d0)) .or. (.not. (y <= 88000.0d0))) then
tmp = y * (t / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -175000000000.0) || !(y <= 88000.0)) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -175000000000.0) or not (y <= 88000.0): tmp = y * (t / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -175000000000.0) || !(y <= 88000.0)) tmp = Float64(y * Float64(t / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -175000000000.0) || ~((y <= 88000.0))) tmp = y * (t / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -175000000000.0], N[Not[LessEqual[y, 88000.0]], $MachinePrecision]], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -175000000000 \lor \neg \left(y \leq 88000\right):\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.75e11 or 88000 < y Initial program 83.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 38.5%
*-commutative38.5%
associate-/l*43.9%
Simplified43.9%
if -1.75e11 < y < 88000Initial program 99.9%
associate-/l*92.2%
Simplified92.2%
Taylor expanded in x around inf 59.4%
Final simplification52.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.45e+24) (/ y (/ a t)) (if (<= y 39.0) x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.45e+24) {
tmp = y / (a / t);
} else if (y <= 39.0) {
tmp = x;
} else {
tmp = t / (a / y);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-1.45d+24)) then
tmp = y / (a / t)
else if (y <= 39.0d0) then
tmp = x
else
tmp = t / (a / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.45e+24) {
tmp = y / (a / t);
} else if (y <= 39.0) {
tmp = x;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.45e+24: tmp = y / (a / t) elif y <= 39.0: tmp = x else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.45e+24) tmp = Float64(y / Float64(a / t)); elseif (y <= 39.0) tmp = x; else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.45e+24) tmp = y / (a / t); elseif (y <= 39.0) tmp = x; else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.45e+24], N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 39.0], x, N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+24}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;y \leq 39:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < -1.4499999999999999e24Initial program 85.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 36.6%
*-commutative36.6%
Simplified36.6%
associate-/l*39.7%
*-commutative39.7%
Applied egg-rr39.7%
*-commutative39.7%
clear-num39.7%
un-div-inv39.8%
Applied egg-rr39.8%
if -1.4499999999999999e24 < y < 39Initial program 99.9%
associate-/l*92.3%
Simplified92.3%
Taylor expanded in x around inf 58.2%
if 39 < y Initial program 79.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 40.6%
*-commutative40.6%
Simplified40.6%
associate-/l*48.6%
*-commutative48.6%
Applied egg-rr48.6%
associate-/r/54.9%
Applied egg-rr54.9%
(FPCore (x y z t a) :precision binary64 (if (<= y -340000000000.0) (* y (/ t a)) (if (<= y 68.0) x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -340000000000.0) {
tmp = y * (t / a);
} else if (y <= 68.0) {
tmp = x;
} else {
tmp = t / (a / y);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-340000000000.0d0)) then
tmp = y * (t / a)
else if (y <= 68.0d0) then
tmp = x
else
tmp = t / (a / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -340000000000.0) {
tmp = y * (t / a);
} else if (y <= 68.0) {
tmp = x;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -340000000000.0: tmp = y * (t / a) elif y <= 68.0: tmp = x else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -340000000000.0) tmp = Float64(y * Float64(t / a)); elseif (y <= 68.0) tmp = x; else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -340000000000.0) tmp = y * (t / a); elseif (y <= 68.0) tmp = x; else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -340000000000.0], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 68.0], x, N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -340000000000:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;y \leq 68:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < -3.4e11Initial program 86.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 36.4%
*-commutative36.4%
associate-/l*39.5%
Simplified39.5%
if -3.4e11 < y < 68Initial program 99.9%
associate-/l*92.2%
Simplified92.2%
Taylor expanded in x around inf 59.4%
if 68 < y Initial program 79.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 40.6%
*-commutative40.6%
Simplified40.6%
associate-/l*48.6%
*-commutative48.6%
Applied egg-rr48.6%
associate-/r/54.9%
Applied egg-rr54.9%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.4e+14) (* y (/ t a)) (if (<= y 240000.0) x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.4e+14) {
tmp = y * (t / a);
} else if (y <= 240000.0) {
tmp = x;
} else {
tmp = t * (y / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-4.4d+14)) then
tmp = y * (t / a)
else if (y <= 240000.0d0) then
tmp = x
else
tmp = t * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.4e+14) {
tmp = y * (t / a);
} else if (y <= 240000.0) {
tmp = x;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.4e+14: tmp = y * (t / a) elif y <= 240000.0: tmp = x else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.4e+14) tmp = Float64(y * Float64(t / a)); elseif (y <= 240000.0) tmp = x; else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.4e+14) tmp = y * (t / a); elseif (y <= 240000.0) tmp = x; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.4e+14], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 240000.0], x, N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{+14}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;y \leq 240000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -4.4e14Initial program 86.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 36.4%
*-commutative36.4%
associate-/l*39.5%
Simplified39.5%
if -4.4e14 < y < 2.4e5Initial program 99.9%
associate-/l*92.2%
Simplified92.2%
Taylor expanded in x around inf 59.4%
if 2.4e5 < y Initial program 79.1%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 40.6%
*-commutative40.6%
Simplified40.6%
*-commutative40.6%
associate-/l*54.9%
*-commutative54.9%
Applied egg-rr54.9%
Final simplification53.5%
(FPCore (x y z t a) :precision binary64 (+ x (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y / a) * (t - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
def code(x, y, z, t, a): return x + ((y / a) * (t - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y / a) * Float64(t - z))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y / a) * (t - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{a} \cdot \left(t - z\right)
\end{array}
Initial program 91.8%
*-commutative91.8%
associate-/l*97.2%
Applied egg-rr97.2%
Final simplification97.2%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- t z) a))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((t - z) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / a));
}
def code(x, y, z, t, a): return x + (y * ((t - z) / a))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(t - z) / a))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((t - z) / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{t - z}{a}
\end{array}
Initial program 91.8%
associate-/l*95.8%
Simplified95.8%
Final simplification95.8%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 91.8%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in x around inf 38.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (- z t))))
(if (< y -1.0761266216389975e-10)
(- x (/ 1.0 (/ t_1 y)))
(if (< y 2.894426862792089e-49)
(- x (/ (* y (- z t)) a))
(- x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x - (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = x - (y / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a / (z - t)
if (y < (-1.0761266216389975d-10)) then
tmp = x - (1.0d0 / (t_1 / y))
else if (y < 2.894426862792089d-49) then
tmp = x - ((y * (z - t)) / a)
else
tmp = x - (y / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x - (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = x - (y / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a / (z - t) tmp = 0 if y < -1.0761266216389975e-10: tmp = x - (1.0 / (t_1 / y)) elif y < 2.894426862792089e-49: tmp = x - ((y * (z - t)) / a) else: tmp = x - (y / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(a / Float64(z - t)) tmp = 0.0 if (y < -1.0761266216389975e-10) tmp = Float64(x - Float64(1.0 / Float64(t_1 / y))); elseif (y < 2.894426862792089e-49) tmp = Float64(x - Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x - Float64(y / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a / (z - t); tmp = 0.0; if (y < -1.0761266216389975e-10) tmp = x - (1.0 / (t_1 / y)); elseif (y < 2.894426862792089e-49) tmp = x - ((y * (z - t)) / a); else tmp = x - (y / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x - N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x - \frac{1}{\frac{t\_1}{y}}\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024107
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
:alt
(if (< y -1.0761266216389975e-10) (- x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t))))))
(- x (/ (* y (- z t)) a)))