
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / 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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (- y z) (/ (+ (- t z) 1.0) a))))
double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / 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 - z) + 1.0d0) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y - z) / (((t - z) + 1.0) / a));
}
def code(x, y, z, t, a): return x - ((y - z) / (((t - z) + 1.0) / a))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y - z) / Float64(Float64(Float64(t - z) + 1.0) / a))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y - z) / (((t - z) + 1.0) / a)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y - z), $MachinePrecision] / N[(N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\frac{\left(t - z\right) + 1}{a}}
\end{array}
(FPCore (x y z t a) :precision binary64 (- x (* (/ (- z y) (+ -1.0 (- z t))) a)))
double code(double x, double y, double z, double t, double a) {
return x - (((z - y) / (-1.0 + (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 - (((z - y) / ((-1.0d0) + (z - t))) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((z - y) / (-1.0 + (z - t))) * a);
}
def code(x, y, z, t, a): return x - (((z - y) / (-1.0 + (z - t))) * a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(z - y) / Float64(-1.0 + Float64(z - t))) * a)) end
function tmp = code(x, y, z, t, a) tmp = x - (((z - y) / (-1.0 + (z - t))) * a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(z - y), $MachinePrecision] / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{z - y}{-1 + \left(z - t\right)} \cdot a
\end{array}
Initial program 97.1%
associate-/r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ a (/ t y)))))
(if (<= t -2.9e+48)
t_1
(if (<= t -1.9e-255) (- x a) (if (<= t 1.0) (- x (* y a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a / (t / y));
double tmp;
if (t <= -2.9e+48) {
tmp = t_1;
} else if (t <= -1.9e-255) {
tmp = x - a;
} else if (t <= 1.0) {
tmp = x - (y * a);
} 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) :: tmp
t_1 = x - (a / (t / y))
if (t <= (-2.9d+48)) then
tmp = t_1
else if (t <= (-1.9d-255)) then
tmp = x - a
else if (t <= 1.0d0) then
tmp = x - (y * a)
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 = x - (a / (t / y));
double tmp;
if (t <= -2.9e+48) {
tmp = t_1;
} else if (t <= -1.9e-255) {
tmp = x - a;
} else if (t <= 1.0) {
tmp = x - (y * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a / (t / y)) tmp = 0 if t <= -2.9e+48: tmp = t_1 elif t <= -1.9e-255: tmp = x - a elif t <= 1.0: tmp = x - (y * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a / Float64(t / y))) tmp = 0.0 if (t <= -2.9e+48) tmp = t_1; elseif (t <= -1.9e-255) tmp = Float64(x - a); elseif (t <= 1.0) tmp = Float64(x - Float64(y * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a / (t / y)); tmp = 0.0; if (t <= -2.9e+48) tmp = t_1; elseif (t <= -1.9e-255) tmp = x - a; elseif (t <= 1.0) tmp = x - (y * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(a / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.9e+48], t$95$1, If[LessEqual[t, -1.9e-255], N[(x - a), $MachinePrecision], If[LessEqual[t, 1.0], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{a}{\frac{t}{y}}\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.9 \cdot 10^{-255}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;t \leq 1:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.8999999999999999e48 or 1 < t Initial program 99.0%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 84.7%
Taylor expanded in y around inf 81.6%
*-commutative81.6%
clear-num81.6%
un-div-inv81.7%
Applied egg-rr81.7%
if -2.8999999999999999e48 < t < -1.9e-255Initial program 94.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 72.4%
if -1.9e-255 < t < 1Initial program 97.2%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 98.9%
Taylor expanded in z around 0 72.5%
Final simplification76.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* a (/ y t)))))
(if (<= t -3.5e+47)
t_1
(if (<= t -4.1e-255) (- x a) (if (<= t 1.0) (- x (* y a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (a * (y / t));
double tmp;
if (t <= -3.5e+47) {
tmp = t_1;
} else if (t <= -4.1e-255) {
tmp = x - a;
} else if (t <= 1.0) {
tmp = x - (y * a);
} 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) :: tmp
t_1 = x - (a * (y / t))
if (t <= (-3.5d+47)) then
tmp = t_1
else if (t <= (-4.1d-255)) then
tmp = x - a
else if (t <= 1.0d0) then
tmp = x - (y * a)
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 = x - (a * (y / t));
double tmp;
if (t <= -3.5e+47) {
tmp = t_1;
} else if (t <= -4.1e-255) {
tmp = x - a;
} else if (t <= 1.0) {
tmp = x - (y * a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (a * (y / t)) tmp = 0 if t <= -3.5e+47: tmp = t_1 elif t <= -4.1e-255: tmp = x - a elif t <= 1.0: tmp = x - (y * a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(a * Float64(y / t))) tmp = 0.0 if (t <= -3.5e+47) tmp = t_1; elseif (t <= -4.1e-255) tmp = Float64(x - a); elseif (t <= 1.0) tmp = Float64(x - Float64(y * a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (a * (y / t)); tmp = 0.0; if (t <= -3.5e+47) tmp = t_1; elseif (t <= -4.1e-255) tmp = x - a; elseif (t <= 1.0) tmp = x - (y * a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.5e+47], t$95$1, If[LessEqual[t, -4.1e-255], N[(x - a), $MachinePrecision], If[LessEqual[t, 1.0], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \frac{y}{t}\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -4.1 \cdot 10^{-255}:\\
\;\;\;\;x - a\\
\mathbf{elif}\;t \leq 1:\\
\;\;\;\;x - y \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.50000000000000015e47 or 1 < t Initial program 99.0%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in t around inf 84.7%
Taylor expanded in y around inf 81.6%
if -3.50000000000000015e47 < t < -4.1e-255Initial program 94.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 72.4%
if -4.1e-255 < t < 1Initial program 97.2%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 98.9%
Taylor expanded in z around 0 72.5%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -700000000000.0) (not (<= y 1.12e-39))) (+ x (* y (/ a (+ -1.0 (- z t))))) (+ x (* z (/ a (- (+ t 1.0) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -700000000000.0) || !(y <= 1.12e-39)) {
tmp = x + (y * (a / (-1.0 + (z - t))));
} else {
tmp = x + (z * (a / ((t + 1.0) - 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 <= (-700000000000.0d0)) .or. (.not. (y <= 1.12d-39))) then
tmp = x + (y * (a / ((-1.0d0) + (z - t))))
else
tmp = x + (z * (a / ((t + 1.0d0) - 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 <= -700000000000.0) || !(y <= 1.12e-39)) {
tmp = x + (y * (a / (-1.0 + (z - t))));
} else {
tmp = x + (z * (a / ((t + 1.0) - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -700000000000.0) or not (y <= 1.12e-39): tmp = x + (y * (a / (-1.0 + (z - t)))) else: tmp = x + (z * (a / ((t + 1.0) - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -700000000000.0) || !(y <= 1.12e-39)) tmp = Float64(x + Float64(y * Float64(a / Float64(-1.0 + Float64(z - t))))); else tmp = Float64(x + Float64(z * Float64(a / Float64(Float64(t + 1.0) - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -700000000000.0) || ~((y <= 1.12e-39))) tmp = x + (y * (a / (-1.0 + (z - t)))); else tmp = x + (z * (a / ((t + 1.0) - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -700000000000.0], N[Not[LessEqual[y, 1.12e-39]], $MachinePrecision]], N[(x + N[(y * N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(a / N[(N[(t + 1.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -700000000000 \lor \neg \left(y \leq 1.12 \cdot 10^{-39}\right):\\
\;\;\;\;x + y \cdot \frac{a}{-1 + \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{a}{\left(t + 1\right) - z}\\
\end{array}
\end{array}
if y < -7e11 or 1.12e-39 < y Initial program 96.2%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around inf 85.6%
*-commutative85.6%
associate--l+85.6%
+-commutative85.6%
associate-*r/91.5%
+-commutative91.5%
associate--l+91.5%
associate--l+91.5%
Simplified91.5%
if -7e11 < y < 1.12e-39Initial program 98.3%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around 0 77.5%
mul-1-neg77.5%
*-commutative77.5%
associate--l+77.5%
+-commutative77.5%
associate-*r/94.3%
distribute-rgt-neg-in94.3%
distribute-neg-frac294.3%
+-commutative94.3%
distribute-neg-in94.3%
metadata-eval94.3%
unsub-neg94.3%
associate--r-94.3%
Simplified94.3%
Final simplification92.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -7.6e+46)
(+ x (* y (/ a (+ -1.0 (- z t)))))
(if (<= t 3.1e+46)
(+ x (* a (/ (- y z) (+ z -1.0))))
(- x (/ (- y z) (/ t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -7.6e+46) {
tmp = x + (y * (a / (-1.0 + (z - t))));
} else if (t <= 3.1e+46) {
tmp = x + (a * ((y - z) / (z + -1.0)));
} else {
tmp = x - ((y - z) / (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 <= (-7.6d+46)) then
tmp = x + (y * (a / ((-1.0d0) + (z - t))))
else if (t <= 3.1d+46) then
tmp = x + (a * ((y - z) / (z + (-1.0d0))))
else
tmp = x - ((y - z) / (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 <= -7.6e+46) {
tmp = x + (y * (a / (-1.0 + (z - t))));
} else if (t <= 3.1e+46) {
tmp = x + (a * ((y - z) / (z + -1.0)));
} else {
tmp = x - ((y - z) / (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -7.6e+46: tmp = x + (y * (a / (-1.0 + (z - t)))) elif t <= 3.1e+46: tmp = x + (a * ((y - z) / (z + -1.0))) else: tmp = x - ((y - z) / (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -7.6e+46) tmp = Float64(x + Float64(y * Float64(a / Float64(-1.0 + Float64(z - t))))); elseif (t <= 3.1e+46) tmp = Float64(x + Float64(a * Float64(Float64(y - z) / Float64(z + -1.0)))); else tmp = Float64(x - Float64(Float64(y - z) / Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -7.6e+46) tmp = x + (y * (a / (-1.0 + (z - t)))); elseif (t <= 3.1e+46) tmp = x + (a * ((y - z) / (z + -1.0))); else tmp = x - ((y - z) / (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -7.6e+46], N[(x + N[(y * N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e+46], N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - z), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.6 \cdot 10^{+46}:\\
\;\;\;\;x + y \cdot \frac{a}{-1 + \left(z - t\right)}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+46}:\\
\;\;\;\;x + a \cdot \frac{y - z}{z + -1}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - z}{\frac{t}{a}}\\
\end{array}
\end{array}
if t < -7.5999999999999998e46Initial program 97.7%
associate-/r/99.8%
Simplified99.8%
Taylor expanded in y around inf 74.2%
*-commutative74.2%
associate--l+74.2%
+-commutative74.2%
associate-*r/82.6%
+-commutative82.6%
associate--l+82.6%
associate--l+82.6%
Simplified82.6%
if -7.5999999999999998e46 < t < 3.09999999999999975e46Initial program 95.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around 0 98.2%
if 3.09999999999999975e46 < t Initial program 99.9%
Taylor expanded in t around inf 93.1%
Final simplification94.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.5e+117)
(- x (- a (* y (/ a z))))
(if (<= z 3.8e+106)
(+ x (* y (/ a (+ -1.0 (- z t)))))
(+ x (- (/ y (/ z a)) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.5e+117) {
tmp = x - (a - (y * (a / z)));
} else if (z <= 3.8e+106) {
tmp = x + (y * (a / (-1.0 + (z - t))));
} else {
tmp = x + ((y / (z / a)) - 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 <= (-1.5d+117)) then
tmp = x - (a - (y * (a / z)))
else if (z <= 3.8d+106) then
tmp = x + (y * (a / ((-1.0d0) + (z - t))))
else
tmp = x + ((y / (z / a)) - 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 <= -1.5e+117) {
tmp = x - (a - (y * (a / z)));
} else if (z <= 3.8e+106) {
tmp = x + (y * (a / (-1.0 + (z - t))));
} else {
tmp = x + ((y / (z / a)) - a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.5e+117: tmp = x - (a - (y * (a / z))) elif z <= 3.8e+106: tmp = x + (y * (a / (-1.0 + (z - t)))) else: tmp = x + ((y / (z / a)) - a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.5e+117) tmp = Float64(x - Float64(a - Float64(y * Float64(a / z)))); elseif (z <= 3.8e+106) tmp = Float64(x + Float64(y * Float64(a / Float64(-1.0 + Float64(z - t))))); else tmp = Float64(x + Float64(Float64(y / Float64(z / a)) - a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.5e+117) tmp = x - (a - (y * (a / z))); elseif (z <= 3.8e+106) tmp = x + (y * (a / (-1.0 + (z - t)))); else tmp = x + ((y / (z / a)) - a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.5e+117], N[(x - N[(a - N[(y * N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+106], N[(x + N[(y * N[(a / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / N[(z / a), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+117}:\\
\;\;\;\;x - \left(a - y \cdot \frac{a}{z}\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+106}:\\
\;\;\;\;x + y \cdot \frac{a}{-1 + \left(z - t\right)}\\
\mathbf{else}:\\
\;\;\;\;x + \left(\frac{y}{\frac{z}{a}} - a\right)\\
\end{array}
\end{array}
if z < -1.5e117Initial program 90.9%
Taylor expanded in z around inf 83.9%
mul-1-neg83.9%
distribute-neg-frac283.9%
Simplified83.9%
Taylor expanded in y around 0 86.2%
mul-1-neg86.2%
unsub-neg86.2%
*-commutative86.2%
associate-*r/88.4%
Simplified88.4%
if -1.5e117 < z < 3.7999999999999998e106Initial program 98.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in y around inf 87.5%
*-commutative87.5%
associate--l+87.5%
+-commutative87.5%
associate-*r/91.1%
+-commutative91.1%
associate--l+91.1%
associate--l+91.1%
Simplified91.1%
if 3.7999999999999998e106 < z Initial program 96.9%
Taylor expanded in z around inf 91.3%
mul-1-neg91.3%
distribute-neg-frac291.3%
Simplified91.3%
Taylor expanded in y around 0 79.2%
mul-1-neg79.2%
unsub-neg79.2%
*-commutative79.2%
associate-*r/91.2%
Simplified91.2%
clear-num91.2%
un-div-inv91.3%
Applied egg-rr91.3%
Final simplification90.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.6e+79) (not (<= z 1.7e+22))) (+ x (- (/ y (/ z a)) a)) (+ x (* y (/ a (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.6e+79) || !(z <= 1.7e+22)) {
tmp = x + ((y / (z / a)) - a);
} else {
tmp = x + (y * (a / (-1.0 - t)));
}
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 <= (-6.6d+79)) .or. (.not. (z <= 1.7d+22))) then
tmp = x + ((y / (z / a)) - a)
else
tmp = x + (y * (a / ((-1.0d0) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.6e+79) || !(z <= 1.7e+22)) {
tmp = x + ((y / (z / a)) - a);
} else {
tmp = x + (y * (a / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.6e+79) or not (z <= 1.7e+22): tmp = x + ((y / (z / a)) - a) else: tmp = x + (y * (a / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.6e+79) || !(z <= 1.7e+22)) tmp = Float64(x + Float64(Float64(y / Float64(z / a)) - a)); else tmp = Float64(x + Float64(y * Float64(a / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.6e+79) || ~((z <= 1.7e+22))) tmp = x + ((y / (z / a)) - a); else tmp = x + (y * (a / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.6e+79], N[Not[LessEqual[z, 1.7e+22]], $MachinePrecision]], N[(x + N[(N[(y / N[(z / a), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(a / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+79} \lor \neg \left(z \leq 1.7 \cdot 10^{+22}\right):\\
\;\;\;\;x + \left(\frac{y}{\frac{z}{a}} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{a}{-1 - t}\\
\end{array}
\end{array}
if z < -6.6000000000000003e79 or 1.7e22 < z Initial program 92.9%
Taylor expanded in z around inf 81.5%
mul-1-neg81.5%
distribute-neg-frac281.5%
Simplified81.5%
Taylor expanded in y around 0 80.0%
mul-1-neg80.0%
unsub-neg80.0%
*-commutative80.0%
associate-*r/83.7%
Simplified83.7%
clear-num83.7%
un-div-inv83.8%
Applied egg-rr83.8%
if -6.6000000000000003e79 < z < 1.7e22Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 87.9%
*-commutative87.9%
associate-/l*91.6%
Simplified91.6%
Final simplification88.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.2e+79) (not (<= z 1.8e+22))) (+ x (- (* y (/ a z)) a)) (+ x (* y (/ a (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+79) || !(z <= 1.8e+22)) {
tmp = x + ((y * (a / z)) - a);
} else {
tmp = x + (y * (a / (-1.0 - t)));
}
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 <= (-3.2d+79)) .or. (.not. (z <= 1.8d+22))) then
tmp = x + ((y * (a / z)) - a)
else
tmp = x + (y * (a / ((-1.0d0) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+79) || !(z <= 1.8e+22)) {
tmp = x + ((y * (a / z)) - a);
} else {
tmp = x + (y * (a / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.2e+79) or not (z <= 1.8e+22): tmp = x + ((y * (a / z)) - a) else: tmp = x + (y * (a / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.2e+79) || !(z <= 1.8e+22)) tmp = Float64(x + Float64(Float64(y * Float64(a / z)) - a)); else tmp = Float64(x + Float64(y * Float64(a / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.2e+79) || ~((z <= 1.8e+22))) tmp = x + ((y * (a / z)) - a); else tmp = x + (y * (a / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e+79], N[Not[LessEqual[z, 1.8e+22]], $MachinePrecision]], N[(x + N[(N[(y * N[(a / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(a / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+79} \lor \neg \left(z \leq 1.8 \cdot 10^{+22}\right):\\
\;\;\;\;x + \left(y \cdot \frac{a}{z} - a\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{a}{-1 - t}\\
\end{array}
\end{array}
if z < -3.20000000000000003e79 or 1.8e22 < z Initial program 92.9%
Taylor expanded in z around inf 81.5%
mul-1-neg81.5%
distribute-neg-frac281.5%
Simplified81.5%
Taylor expanded in y around 0 80.0%
mul-1-neg80.0%
unsub-neg80.0%
*-commutative80.0%
associate-*r/83.7%
Simplified83.7%
if -3.20000000000000003e79 < z < 1.8e22Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 87.9%
*-commutative87.9%
associate-/l*91.6%
Simplified91.6%
Final simplification88.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.75e+118) (not (<= z 3.5e+106))) (- x a) (+ x (* y (/ a (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.75e+118) || !(z <= 3.5e+106)) {
tmp = x - a;
} else {
tmp = x + (y * (a / (-1.0 - t)));
}
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 <= (-3.75d+118)) .or. (.not. (z <= 3.5d+106))) then
tmp = x - a
else
tmp = x + (y * (a / ((-1.0d0) - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.75e+118) || !(z <= 3.5e+106)) {
tmp = x - a;
} else {
tmp = x + (y * (a / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.75e+118) or not (z <= 3.5e+106): tmp = x - a else: tmp = x + (y * (a / (-1.0 - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.75e+118) || !(z <= 3.5e+106)) tmp = Float64(x - a); else tmp = Float64(x + Float64(y * Float64(a / Float64(-1.0 - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.75e+118) || ~((z <= 3.5e+106))) tmp = x - a; else tmp = x + (y * (a / (-1.0 - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.75e+118], N[Not[LessEqual[z, 3.5e+106]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(y * N[(a / N[(-1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.75 \cdot 10^{+118} \lor \neg \left(z \leq 3.5 \cdot 10^{+106}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{a}{-1 - t}\\
\end{array}
\end{array}
if z < -3.75000000000000001e118 or 3.49999999999999981e106 < z Initial program 93.5%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 80.6%
if -3.75000000000000001e118 < z < 3.49999999999999981e106Initial program 98.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around 0 83.1%
*-commutative83.1%
associate-/l*87.2%
Simplified87.2%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.6e+32) (not (<= z 7.5e-8))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.6e+32) || !(z <= 7.5e-8)) {
tmp = x - a;
} else {
tmp = x - (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 ((z <= (-4.6d+32)) .or. (.not. (z <= 7.5d-8))) then
tmp = x - a
else
tmp = x - (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 ((z <= -4.6e+32) || !(z <= 7.5e-8)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.6e+32) or not (z <= 7.5e-8): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.6e+32) || !(z <= 7.5e-8)) tmp = Float64(x - a); else tmp = Float64(x - Float64(y * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.6e+32) || ~((z <= 7.5e-8))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.6e+32], N[Not[LessEqual[z, 7.5e-8]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+32} \lor \neg \left(z \leq 7.5 \cdot 10^{-8}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -4.5999999999999999e32 or 7.4999999999999997e-8 < z Initial program 94.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 71.0%
if -4.5999999999999999e32 < z < 7.4999999999999997e-8Initial program 99.9%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in t around 0 77.5%
Taylor expanded in z around 0 72.7%
Final simplification71.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.5e+117) (not (<= z 3.1e-68))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e+117) || !(z <= 3.1e-68)) {
tmp = x - 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 ((z <= (-1.5d+117)) .or. (.not. (z <= 3.1d-68))) then
tmp = x - 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 ((z <= -1.5e+117) || !(z <= 3.1e-68)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.5e+117) or not (z <= 3.1e-68): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.5e+117) || !(z <= 3.1e-68)) tmp = Float64(x - a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.5e+117) || ~((z <= 3.1e-68))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.5e+117], N[Not[LessEqual[z, 3.1e-68]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+117} \lor \neg \left(z \leq 3.1 \cdot 10^{-68}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.5e117 or 3.0999999999999999e-68 < z Initial program 94.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 72.9%
if -1.5e117 < z < 3.0999999999999999e-68Initial program 99.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 60.7%
Taylor expanded in x around inf 57.0%
Final simplification64.2%
(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 97.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 50.6%
Taylor expanded in x around inf 54.4%
(FPCore (x y z t a) :precision binary64 (- x (* (/ (- y z) (+ (- t z) 1.0)) a)))
double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * 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 - z) + 1.0d0)) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (((y - z) / ((t - z) + 1.0)) * a);
}
def code(x, y, z, t, a): return x - (((y - z) / ((t - z) + 1.0)) * a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(Float64(y - z) / Float64(Float64(t - z) + 1.0)) * a)) end
function tmp = code(x, y, z, t, a) tmp = x - (((y - z) / ((t - z) + 1.0)) * a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(N[(y - z), $MachinePrecision] / N[(N[(t - z), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y - z}{\left(t - z\right) + 1} \cdot a
\end{array}
herbie shell --seed 2024106
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(- x (* (/ (- y z) (+ (- t z) 1.0)) a))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))