
(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 15 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
(let* ((t_1 (* y (- z t))))
(if (or (<= t_1 -5e+201) (not (<= t_1 1e+161)))
(- x (/ (- z t) (/ a y)))
(+ x (/ (* y (- t z)) a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double tmp;
if ((t_1 <= -5e+201) || !(t_1 <= 1e+161)) {
tmp = x - ((z - t) / (a / y));
} else {
tmp = x + ((y * (t - z)) / 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) :: t_1
real(8) :: tmp
t_1 = y * (z - t)
if ((t_1 <= (-5d+201)) .or. (.not. (t_1 <= 1d+161))) then
tmp = x - ((z - t) / (a / y))
else
tmp = x + ((y * (t - z)) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z - t);
double tmp;
if ((t_1 <= -5e+201) || !(t_1 <= 1e+161)) {
tmp = x - ((z - t) / (a / y));
} else {
tmp = x + ((y * (t - z)) / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z - t) tmp = 0 if (t_1 <= -5e+201) or not (t_1 <= 1e+161): tmp = x - ((z - t) / (a / y)) else: tmp = x + ((y * (t - z)) / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z - t)) tmp = 0.0 if ((t_1 <= -5e+201) || !(t_1 <= 1e+161)) tmp = Float64(x - Float64(Float64(z - t) / Float64(a / y))); else tmp = Float64(x + Float64(Float64(y * Float64(t - z)) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z - t); tmp = 0.0; if ((t_1 <= -5e+201) || ~((t_1 <= 1e+161))) tmp = x - ((z - t) / (a / y)); else tmp = x + ((y * (t - z)) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+201], N[Not[LessEqual[t$95$1, 1e+161]], $MachinePrecision]], N[(x - N[(N[(z - t), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(z - t\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+201} \lor \neg \left(t\_1 \leq 10^{+161}\right):\\
\;\;\;\;x - \frac{z - t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a}\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -4.9999999999999995e201 or 1e161 < (*.f64 y (-.f64 z t)) Initial program 85.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 85.3%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 71.7%
mul-1-neg71.7%
associate-/l*70.6%
distribute-lft-neg-out70.6%
associate-*l/76.1%
*-commutative76.1%
+-commutative76.1%
distribute-rgt-out99.8%
sub-neg99.8%
associate-*l/85.3%
associate-*r/99.8%
*-commutative99.8%
associate-/r/99.9%
Simplified99.9%
if -4.9999999999999995e201 < (*.f64 y (-.f64 z t)) < 1e161Initial program 99.8%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) a)))
(if (<= t_1 -2e+301)
(+ x (* (/ y a) (- t z)))
(if (<= t_1 5e+274)
(+ x (/ (* y (- t z)) a))
(+ x (/ y (/ a (- t z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -2e+301) {
tmp = x + ((y / a) * (t - z));
} else if (t_1 <= 5e+274) {
tmp = x + ((y * (t - z)) / a);
} else {
tmp = x + (y / (a / (t - z)));
}
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 = (y * (z - t)) / a
if (t_1 <= (-2d+301)) then
tmp = x + ((y / a) * (t - z))
else if (t_1 <= 5d+274) then
tmp = x + ((y * (t - z)) / a)
else
tmp = x + (y / (a / (t - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -2e+301) {
tmp = x + ((y / a) * (t - z));
} else if (t_1 <= 5e+274) {
tmp = x + ((y * (t - z)) / a);
} else {
tmp = x + (y / (a / (t - z)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a tmp = 0 if t_1 <= -2e+301: tmp = x + ((y / a) * (t - z)) elif t_1 <= 5e+274: tmp = x + ((y * (t - z)) / a) else: tmp = x + (y / (a / (t - z))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) tmp = 0.0 if (t_1 <= -2e+301) tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); elseif (t_1 <= 5e+274) tmp = Float64(x + Float64(Float64(y * Float64(t - z)) / a)); else tmp = Float64(x + Float64(y / Float64(a / Float64(t - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; tmp = 0.0; if (t_1 <= -2e+301) tmp = x + ((y / a) * (t - z)); elseif (t_1 <= 5e+274) tmp = x + ((y * (t - z)) / a); else tmp = x + (y / (a / (t - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+301], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+274], N[(x + N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+301}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+274}:\\
\;\;\;\;x + \frac{y \cdot \left(t - z\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t - z}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -2.00000000000000011e301Initial program 88.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 88.4%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
if -2.00000000000000011e301 < (/.f64 (*.f64 y (-.f64 z t)) a) < 4.9999999999999998e274Initial program 99.8%
if 4.9999999999999998e274 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 78.3%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= x -2.3e+39)
x
(if (<= x -6.2e-130)
(/ (* y t) a)
(if (<= x 1.45e-285)
(/ z (/ (- a) y))
(if (<= x 1.25e+93) (/ t (/ a y)) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.3e+39) {
tmp = x;
} else if (x <= -6.2e-130) {
tmp = (y * t) / a;
} else if (x <= 1.45e-285) {
tmp = z / (-a / y);
} else if (x <= 1.25e+93) {
tmp = t / (a / y);
} 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 (x <= (-2.3d+39)) then
tmp = x
else if (x <= (-6.2d-130)) then
tmp = (y * t) / a
else if (x <= 1.45d-285) then
tmp = z / (-a / y)
else if (x <= 1.25d+93) then
tmp = t / (a / y)
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 (x <= -2.3e+39) {
tmp = x;
} else if (x <= -6.2e-130) {
tmp = (y * t) / a;
} else if (x <= 1.45e-285) {
tmp = z / (-a / y);
} else if (x <= 1.25e+93) {
tmp = t / (a / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.3e+39: tmp = x elif x <= -6.2e-130: tmp = (y * t) / a elif x <= 1.45e-285: tmp = z / (-a / y) elif x <= 1.25e+93: tmp = t / (a / y) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.3e+39) tmp = x; elseif (x <= -6.2e-130) tmp = Float64(Float64(y * t) / a); elseif (x <= 1.45e-285) tmp = Float64(z / Float64(Float64(-a) / y)); elseif (x <= 1.25e+93) tmp = Float64(t / Float64(a / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.3e+39) tmp = x; elseif (x <= -6.2e-130) tmp = (y * t) / a; elseif (x <= 1.45e-285) tmp = z / (-a / y); elseif (x <= 1.25e+93) tmp = t / (a / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.3e+39], x, If[LessEqual[x, -6.2e-130], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[x, 1.45e-285], N[(z / N[((-a) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.25e+93], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.3 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-130}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-285}:\\
\;\;\;\;\frac{z}{\frac{-a}{y}}\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+93}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.30000000000000012e39 or 1.25e93 < x Initial program 94.6%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in x around inf 68.9%
if -2.30000000000000012e39 < x < -6.20000000000000021e-130Initial program 90.9%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in t around inf 53.4%
if -6.20000000000000021e-130 < x < 1.45e-285Initial program 95.0%
associate-/l*90.0%
Simplified90.0%
Taylor expanded in z around inf 49.9%
mul-1-neg49.9%
associate-/l*50.2%
distribute-rgt-neg-in50.2%
distribute-neg-frac250.2%
Simplified50.2%
associate-*r/49.9%
frac-2neg49.9%
remove-double-neg49.9%
*-commutative49.9%
distribute-rgt-neg-in49.9%
Applied egg-rr49.9%
*-commutative49.9%
associate-/l*50.2%
distribute-lft-neg-in50.2%
*-commutative50.2%
associate-/r/54.1%
Applied egg-rr54.1%
if 1.45e-285 < x < 1.25e93Initial program 95.0%
associate-/l*90.4%
Simplified90.4%
Taylor expanded in t around inf 48.9%
associate-/l*50.1%
Simplified50.1%
clear-num50.1%
div-inv50.2%
Applied egg-rr50.2%
Final simplification58.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -7.5e+88) (not (<= y 1.75e+143))) (* y (/ (- t z) a)) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -7.5e+88) || !(y <= 1.75e+143)) {
tmp = y * ((t - z) / a);
} else {
tmp = x + ((y * t) / 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 <= (-7.5d+88)) .or. (.not. (y <= 1.75d+143))) then
tmp = y * ((t - z) / a)
else
tmp = x + ((y * t) / 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 <= -7.5e+88) || !(y <= 1.75e+143)) {
tmp = y * ((t - z) / a);
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -7.5e+88) or not (y <= 1.75e+143): tmp = y * ((t - z) / a) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -7.5e+88) || !(y <= 1.75e+143)) tmp = Float64(y * Float64(Float64(t - z) / a)); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -7.5e+88) || ~((y <= 1.75e+143))) tmp = y * ((t - z) / a); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -7.5e+88], N[Not[LessEqual[y, 1.75e+143]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+88} \lor \neg \left(y \leq 1.75 \cdot 10^{+143}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if y < -7.50000000000000031e88 or 1.75000000000000004e143 < y Initial program 85.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 77.2%
mul-1-neg77.2%
distribute-frac-neg277.2%
sub-neg77.2%
+-commutative77.2%
neg-sub077.2%
associate--r-77.2%
neg-sub077.2%
associate-*r/88.8%
distribute-neg-frac88.8%
distribute-neg-frac288.8%
remove-double-neg88.8%
Simplified88.8%
if -7.50000000000000031e88 < y < 1.75000000000000004e143Initial program 98.2%
sub-neg98.2%
distribute-frac-neg298.2%
+-commutative98.2%
associate-/l*88.5%
fma-define88.5%
distribute-frac-neg288.5%
distribute-neg-frac88.5%
sub-neg88.5%
distribute-neg-in88.5%
remove-double-neg88.5%
+-commutative88.5%
sub-neg88.5%
Simplified88.5%
Taylor expanded in z around 0 80.3%
Final simplification82.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e+80) (not (<= z 1200000.0))) (- x (* y (/ z a))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e+80) || !(z <= 1200000.0)) {
tmp = x - (y * (z / a));
} else {
tmp = x + ((y * t) / 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 ((z <= (-4.8d+80)) .or. (.not. (z <= 1200000.0d0))) then
tmp = x - (y * (z / a))
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e+80) || !(z <= 1200000.0)) {
tmp = x - (y * (z / a));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e+80) or not (z <= 1200000.0): tmp = x - (y * (z / a)) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e+80) || !(z <= 1200000.0)) tmp = Float64(x - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.8e+80) || ~((z <= 1200000.0))) tmp = x - (y * (z / a)); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e+80], N[Not[LessEqual[z, 1200000.0]], $MachinePrecision]], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+80} \lor \neg \left(z \leq 1200000\right):\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -4.79999999999999958e80 or 1.2e6 < z Initial program 87.0%
associate-/l*88.9%
Simplified88.9%
Taylor expanded in z around inf 83.1%
associate-/l*83.3%
Simplified83.3%
if -4.79999999999999958e80 < z < 1.2e6Initial program 99.3%
sub-neg99.3%
distribute-frac-neg299.3%
+-commutative99.3%
associate-/l*94.1%
fma-define94.1%
distribute-frac-neg294.1%
distribute-neg-frac94.1%
sub-neg94.1%
distribute-neg-in94.1%
remove-double-neg94.1%
+-commutative94.1%
sub-neg94.1%
Simplified94.1%
Taylor expanded in z around 0 91.3%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2e+80) (not (<= z 0.00125))) (- x (* z (/ y a))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2e+80) || !(z <= 0.00125)) {
tmp = x - (z * (y / a));
} else {
tmp = x + ((y * t) / 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 ((z <= (-2d+80)) .or. (.not. (z <= 0.00125d0))) then
tmp = x - (z * (y / a))
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2e+80) || !(z <= 0.00125)) {
tmp = x - (z * (y / a));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2e+80) or not (z <= 0.00125): tmp = x - (z * (y / a)) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2e+80) || !(z <= 0.00125)) tmp = Float64(x - Float64(z * Float64(y / a))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2e+80) || ~((z <= 0.00125))) tmp = x - (z * (y / a)); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2e+80], N[Not[LessEqual[z, 0.00125]], $MachinePrecision]], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+80} \lor \neg \left(z \leq 0.00125\right):\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -2e80 or 0.00125000000000000003 < z Initial program 87.0%
associate-/l*88.9%
Simplified88.9%
Taylor expanded in z around inf 83.1%
*-commutative83.1%
associate-/l*91.0%
Applied egg-rr91.0%
if -2e80 < z < 0.00125000000000000003Initial program 99.3%
sub-neg99.3%
distribute-frac-neg299.3%
+-commutative99.3%
associate-/l*94.1%
fma-define94.1%
distribute-frac-neg294.1%
distribute-neg-frac94.1%
sub-neg94.1%
distribute-neg-in94.1%
remove-double-neg94.1%
+-commutative94.1%
sub-neg94.1%
Simplified94.1%
Taylor expanded in z around 0 91.3%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.4e+80) (not (<= z 95.0))) (- x (/ z (/ a y))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e+80) || !(z <= 95.0)) {
tmp = x - (z / (a / y));
} else {
tmp = x + ((y * t) / 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 ((z <= (-2.4d+80)) .or. (.not. (z <= 95.0d0))) then
tmp = x - (z / (a / y))
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e+80) || !(z <= 95.0)) {
tmp = x - (z / (a / y));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.4e+80) or not (z <= 95.0): tmp = x - (z / (a / y)) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.4e+80) || !(z <= 95.0)) tmp = Float64(x - Float64(z / Float64(a / y))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.4e+80) || ~((z <= 95.0))) tmp = x - (z / (a / y)); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.4e+80], N[Not[LessEqual[z, 95.0]], $MachinePrecision]], N[(x - N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+80} \lor \neg \left(z \leq 95\right):\\
\;\;\;\;x - \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -2.39999999999999979e80 or 95 < z Initial program 87.0%
associate-/l*88.9%
Simplified88.9%
Taylor expanded in z around inf 83.1%
associate-/l*83.3%
*-commutative83.3%
Applied egg-rr83.3%
associate-/r/91.0%
Applied egg-rr91.0%
if -2.39999999999999979e80 < z < 95Initial program 99.3%
sub-neg99.3%
distribute-frac-neg299.3%
+-commutative99.3%
associate-/l*94.1%
fma-define94.1%
distribute-frac-neg294.1%
distribute-neg-frac94.1%
sub-neg94.1%
distribute-neg-in94.1%
remove-double-neg94.1%
+-commutative94.1%
sub-neg94.1%
Simplified94.1%
Taylor expanded in z around 0 91.3%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (<= x -2.8e+97) x (if (<= x 2.35e+119) (* y (/ (- t z) a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.8e+97) {
tmp = x;
} else if (x <= 2.35e+119) {
tmp = y * ((t - z) / 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 (x <= (-2.8d+97)) then
tmp = x
else if (x <= 2.35d+119) then
tmp = y * ((t - z) / 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 (x <= -2.8e+97) {
tmp = x;
} else if (x <= 2.35e+119) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.8e+97: tmp = x elif x <= 2.35e+119: tmp = y * ((t - z) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.8e+97) tmp = x; elseif (x <= 2.35e+119) tmp = Float64(y * Float64(Float64(t - z) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.8e+97) tmp = x; elseif (x <= 2.35e+119) tmp = y * ((t - z) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.8e+97], x, If[LessEqual[x, 2.35e+119], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+97}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{+119}:\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.7999999999999999e97 or 2.35000000000000004e119 < x Initial program 93.3%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in x around inf 75.0%
if -2.7999999999999999e97 < x < 2.35000000000000004e119Initial program 94.9%
associate-/l*91.5%
Simplified91.5%
Taylor expanded in x around 0 71.8%
mul-1-neg71.8%
distribute-frac-neg271.8%
sub-neg71.8%
+-commutative71.8%
neg-sub071.8%
associate--r-71.8%
neg-sub071.8%
associate-*r/69.0%
distribute-neg-frac69.0%
distribute-neg-frac269.0%
remove-double-neg69.0%
Simplified69.0%
Final simplification71.0%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.9e+37) x (if (<= a 4000000000.0) (* t (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.9e+37) {
tmp = x;
} else if (a <= 4000000000.0) {
tmp = t * (y / 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 (a <= (-2.9d+37)) then
tmp = x
else if (a <= 4000000000.0d0) then
tmp = t * (y / 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 (a <= -2.9e+37) {
tmp = x;
} else if (a <= 4000000000.0) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.9e+37: tmp = x elif a <= 4000000000.0: tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.9e+37) tmp = x; elseif (a <= 4000000000.0) tmp = Float64(t * Float64(y / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.9e+37) tmp = x; elseif (a <= 4000000000.0) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.9e+37], x, If[LessEqual[a, 4000000000.0], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.9 \cdot 10^{+37}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4000000000:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.89999999999999978e37 or 4e9 < a Initial program 88.2%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in x around inf 64.4%
if -2.89999999999999978e37 < a < 4e9Initial program 99.2%
associate-/l*86.5%
Simplified86.5%
Taylor expanded in t around inf 49.5%
associate-/l*49.5%
Simplified49.5%
Final simplification56.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -9e+38) x (if (<= a 3600000000.0) (/ t (/ a y)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9e+38) {
tmp = x;
} else if (a <= 3600000000.0) {
tmp = t / (a / y);
} 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 (a <= (-9d+38)) then
tmp = x
else if (a <= 3600000000.0d0) then
tmp = t / (a / y)
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 (a <= -9e+38) {
tmp = x;
} else if (a <= 3600000000.0) {
tmp = t / (a / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9e+38: tmp = x elif a <= 3600000000.0: tmp = t / (a / y) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9e+38) tmp = x; elseif (a <= 3600000000.0) tmp = Float64(t / Float64(a / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9e+38) tmp = x; elseif (a <= 3600000000.0) tmp = t / (a / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9e+38], x, If[LessEqual[a, 3600000000.0], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3600000000:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -8.99999999999999961e38 or 3.6e9 < a Initial program 88.2%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in x around inf 64.4%
if -8.99999999999999961e38 < a < 3.6e9Initial program 99.2%
associate-/l*86.5%
Simplified86.5%
Taylor expanded in t around inf 49.5%
associate-/l*49.5%
Simplified49.5%
clear-num49.5%
div-inv49.5%
Applied egg-rr49.5%
Final simplification56.1%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.55e+39) x (if (<= x 7.2e+93) (/ (* y t) a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.55e+39) {
tmp = x;
} else if (x <= 7.2e+93) {
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 (x <= (-1.55d+39)) then
tmp = x
else if (x <= 7.2d+93) 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 (x <= -1.55e+39) {
tmp = x;
} else if (x <= 7.2e+93) {
tmp = (y * t) / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.55e+39: tmp = x elif x <= 7.2e+93: tmp = (y * t) / a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.55e+39) tmp = x; elseif (x <= 7.2e+93) tmp = Float64(Float64(y * t) / a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.55e+39) tmp = x; elseif (x <= 7.2e+93) tmp = (y * t) / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.55e+39], x, If[LessEqual[x, 7.2e+93], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{+93}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.5500000000000001e39 or 7.1999999999999998e93 < x Initial program 94.6%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in x around inf 68.9%
if -1.5500000000000001e39 < x < 7.1999999999999998e93Initial program 94.2%
associate-/l*90.9%
Simplified90.9%
Taylor expanded in t around inf 45.8%
Final simplification55.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 4.4e+136) (+ x (* y (/ (- t z) a))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.4e+136) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + ((y * t) / 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 <= 4.4d+136) then
tmp = x + (y * ((t - z) / a))
else
tmp = x + ((y * t) / 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 <= 4.4e+136) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4.4e+136: tmp = x + (y * ((t - z) / a)) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.4e+136) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 4.4e+136) tmp = x + (y * ((t - z) / a)); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.4e+136], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.4 \cdot 10^{+136}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if t < 4.3999999999999999e136Initial program 93.6%
associate-/l*93.1%
Simplified93.1%
if 4.3999999999999999e136 < t Initial program 100.0%
sub-neg100.0%
distribute-frac-neg2100.0%
+-commutative100.0%
associate-/l*83.9%
fma-define83.9%
distribute-frac-neg283.9%
distribute-neg-frac83.9%
sub-neg83.9%
distribute-neg-in83.9%
remove-double-neg83.9%
+-commutative83.9%
sub-neg83.9%
Simplified83.9%
Taylor expanded in z around 0 99.0%
Final simplification93.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.7e-201) (+ x (* y (/ (- t z) a))) (+ x (* (/ y a) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.7e-201) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + ((y / a) * (t - z));
}
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.7d-201)) then
tmp = x + (y * ((t - z) / a))
else
tmp = x + ((y / a) * (t - z))
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.7e-201) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + ((y / a) * (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.7e-201: tmp = x + (y * ((t - z) / a)) else: tmp = x + ((y / a) * (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.7e-201) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.7e-201) tmp = x + (y * ((t - z) / a)); else tmp = x + ((y / a) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.7e-201], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-201}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if y < -1.69999999999999993e-201Initial program 91.1%
associate-/l*97.1%
Simplified97.1%
if -1.69999999999999993e-201 < y Initial program 96.7%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in y around 0 96.7%
associate-*l/98.6%
*-commutative98.6%
Simplified98.6%
Final simplification98.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -5e-194) (+ x (/ y (/ a (- t z)))) (+ x (* (/ y a) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5e-194) {
tmp = x + (y / (a / (t - z)));
} else {
tmp = x + ((y / a) * (t - z));
}
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 <= (-5d-194)) then
tmp = x + (y / (a / (t - z)))
else
tmp = x + ((y / a) * (t - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5e-194) {
tmp = x + (y / (a / (t - z)));
} else {
tmp = x + ((y / a) * (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5e-194: tmp = x + (y / (a / (t - z))) else: tmp = x + ((y / a) * (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5e-194) tmp = Float64(x + Float64(y / Float64(a / Float64(t - z)))); else tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5e-194) tmp = x + (y / (a / (t - z))); else tmp = x + ((y / a) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5e-194], N[(x + N[(y / N[(a / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-194}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t - z}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if y < -5.0000000000000002e-194Initial program 91.0%
associate-/l*97.1%
Simplified97.1%
clear-num97.1%
un-div-inv97.2%
Applied egg-rr97.2%
if -5.0000000000000002e-194 < y Initial program 96.7%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in y around 0 96.7%
associate-*l/98.6%
*-commutative98.6%
Simplified98.6%
Final simplification98.0%
(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 94.3%
associate-/l*92.0%
Simplified92.0%
Taylor expanded in x around inf 41.7%
Final simplification41.7%
(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 2024040
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
:herbie-target
(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)))