
(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 11 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 (* a (/ (- y z) (+ -1.0 (- z t))))))
double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 + (z - t))));
}
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 + (a * ((y - z) / ((-1.0d0) + (z - t))))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (a * ((y - z) / (-1.0 + (z - t))));
}
def code(x, y, z, t, a): return x + (a * ((y - z) / (-1.0 + (z - t))))
function code(x, y, z, t, a) return Float64(x + Float64(a * Float64(Float64(y - z) / Float64(-1.0 + Float64(z - t))))) end
function tmp = code(x, y, z, t, a) tmp = x + (a * ((y - z) / (-1.0 + (z - t)))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(a * N[(N[(y - z), $MachinePrecision] / N[(-1.0 + N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + a \cdot \frac{y - z}{-1 + \left(z - t\right)}
\end{array}
Initial program 98.0%
associate-/r/99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.0)
(- x (* y (/ a t)))
(if (<= t 1.15e-75)
(- x (* y a))
(if (<= t 6.6e+80) (- x a) (- x (* a (/ y t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.0) {
tmp = x - (y * (a / t));
} else if (t <= 1.15e-75) {
tmp = x - (y * a);
} else if (t <= 6.6e+80) {
tmp = x - a;
} else {
tmp = x - (a * (y / 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 (t <= (-1.0d0)) then
tmp = x - (y * (a / t))
else if (t <= 1.15d-75) then
tmp = x - (y * a)
else if (t <= 6.6d+80) then
tmp = x - a
else
tmp = x - (a * (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.0) {
tmp = x - (y * (a / t));
} else if (t <= 1.15e-75) {
tmp = x - (y * a);
} else if (t <= 6.6e+80) {
tmp = x - a;
} else {
tmp = x - (a * (y / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.0: tmp = x - (y * (a / t)) elif t <= 1.15e-75: tmp = x - (y * a) elif t <= 6.6e+80: tmp = x - a else: tmp = x - (a * (y / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.0) tmp = Float64(x - Float64(y * Float64(a / t))); elseif (t <= 1.15e-75) tmp = Float64(x - Float64(y * a)); elseif (t <= 6.6e+80) tmp = Float64(x - a); else tmp = Float64(x - Float64(a * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.0) tmp = x - (y * (a / t)); elseif (t <= 1.15e-75) tmp = x - (y * a); elseif (t <= 6.6e+80) tmp = x - a; else tmp = x - (a * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.0], N[(x - N[(y * N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.15e-75], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.6e+80], N[(x - a), $MachinePrecision], N[(x - N[(a * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1:\\
\;\;\;\;x - y \cdot \frac{a}{t}\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{-75}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+80}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - a \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -1Initial program 97.3%
Taylor expanded in t around inf 81.3%
Taylor expanded in y around inf 80.0%
div-inv80.0%
clear-num80.0%
Applied egg-rr80.0%
if -1 < t < 1.15e-75Initial program 98.2%
Taylor expanded in t around 0 97.3%
Taylor expanded in z around 0 70.4%
if 1.15e-75 < t < 6.59999999999999982e80Initial program 99.8%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in z around inf 71.8%
if 6.59999999999999982e80 < t Initial program 97.7%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 89.7%
Taylor expanded in y around inf 81.6%
Final simplification75.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* y (/ a t)))))
(if (<= t -1.0)
t_1
(if (<= t 2.4e-79) (- x (* y a)) (if (<= t 2.05e+79) (- x a) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y * (a / t));
double tmp;
if (t <= -1.0) {
tmp = t_1;
} else if (t <= 2.4e-79) {
tmp = x - (y * a);
} else if (t <= 2.05e+79) {
tmp = x - 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 - (y * (a / t))
if (t <= (-1.0d0)) then
tmp = t_1
else if (t <= 2.4d-79) then
tmp = x - (y * a)
else if (t <= 2.05d+79) then
tmp = x - 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 - (y * (a / t));
double tmp;
if (t <= -1.0) {
tmp = t_1;
} else if (t <= 2.4e-79) {
tmp = x - (y * a);
} else if (t <= 2.05e+79) {
tmp = x - a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y * (a / t)) tmp = 0 if t <= -1.0: tmp = t_1 elif t <= 2.4e-79: tmp = x - (y * a) elif t <= 2.05e+79: tmp = x - a else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y * Float64(a / t))) tmp = 0.0 if (t <= -1.0) tmp = t_1; elseif (t <= 2.4e-79) tmp = Float64(x - Float64(y * a)); elseif (t <= 2.05e+79) tmp = Float64(x - a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y * (a / t)); tmp = 0.0; if (t <= -1.0) tmp = t_1; elseif (t <= 2.4e-79) tmp = x - (y * a); elseif (t <= 2.05e+79) tmp = x - a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y * N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.0], t$95$1, If[LessEqual[t, 2.4e-79], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.05e+79], N[(x - a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - y \cdot \frac{a}{t}\\
\mathbf{if}\;t \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-79}:\\
\;\;\;\;x - y \cdot a\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{+79}:\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1 or 2.05e79 < t Initial program 97.4%
Taylor expanded in t around inf 83.6%
Taylor expanded in y around inf 79.8%
div-inv79.8%
clear-num79.8%
Applied egg-rr79.8%
if -1 < t < 2.40000000000000006e-79Initial program 98.2%
Taylor expanded in t around 0 97.3%
Taylor expanded in z around 0 70.4%
if 2.40000000000000006e-79 < t < 2.05e79Initial program 99.8%
associate-/r/99.7%
Simplified99.7%
Taylor expanded in z around inf 71.8%
Final simplification74.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4e+123)
(+ x (/ (- z y) (/ t a)))
(if (<= t 4.5e+25)
(+ x (/ a (/ (- 1.0 z) (- z y))))
(+ x (* a (/ (- z y) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4e+123) {
tmp = x + ((z - y) / (t / a));
} else if (t <= 4.5e+25) {
tmp = x + (a / ((1.0 - z) / (z - y)));
} else {
tmp = x + (a * ((z - y) / 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 (t <= (-4d+123)) then
tmp = x + ((z - y) / (t / a))
else if (t <= 4.5d+25) then
tmp = x + (a / ((1.0d0 - z) / (z - y)))
else
tmp = x + (a * ((z - y) / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4e+123) {
tmp = x + ((z - y) / (t / a));
} else if (t <= 4.5e+25) {
tmp = x + (a / ((1.0 - z) / (z - y)));
} else {
tmp = x + (a * ((z - y) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4e+123: tmp = x + ((z - y) / (t / a)) elif t <= 4.5e+25: tmp = x + (a / ((1.0 - z) / (z - y))) else: tmp = x + (a * ((z - y) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4e+123) tmp = Float64(x + Float64(Float64(z - y) / Float64(t / a))); elseif (t <= 4.5e+25) tmp = Float64(x + Float64(a / Float64(Float64(1.0 - z) / Float64(z - y)))); else tmp = Float64(x + Float64(a * Float64(Float64(z - y) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4e+123) tmp = x + ((z - y) / (t / a)); elseif (t <= 4.5e+25) tmp = x + (a / ((1.0 - z) / (z - y))); else tmp = x + (a * ((z - y) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4e+123], N[(x + N[(N[(z - y), $MachinePrecision] / N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e+25], N[(x + N[(a / N[(N[(1.0 - z), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(N[(z - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+123}:\\
\;\;\;\;x + \frac{z - y}{\frac{t}{a}}\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+25}:\\
\;\;\;\;x + \frac{a}{\frac{1 - z}{z - y}}\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \frac{z - y}{t}\\
\end{array}
\end{array}
if t < -3.99999999999999991e123Initial program 97.4%
Taylor expanded in t around inf 90.6%
if -3.99999999999999991e123 < t < 4.5000000000000003e25Initial program 98.1%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in t around 0 94.8%
if 4.5000000000000003e25 < t Initial program 98.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in t around inf 87.8%
Final simplification92.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.45e+19) (not (<= z 4.2e-11))) (+ x (/ (- y z) (/ z a))) (+ x (/ a (/ (- -1.0 t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.45e+19) || !(z <= 4.2e-11)) {
tmp = x + ((y - z) / (z / a));
} else {
tmp = x + (a / ((-1.0 - t) / 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.45d+19)) .or. (.not. (z <= 4.2d-11))) then
tmp = x + ((y - z) / (z / a))
else
tmp = x + (a / (((-1.0d0) - t) / 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.45e+19) || !(z <= 4.2e-11)) {
tmp = x + ((y - z) / (z / a));
} else {
tmp = x + (a / ((-1.0 - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.45e+19) or not (z <= 4.2e-11): tmp = x + ((y - z) / (z / a)) else: tmp = x + (a / ((-1.0 - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.45e+19) || !(z <= 4.2e-11)) tmp = Float64(x + Float64(Float64(y - z) / Float64(z / a))); else tmp = Float64(x + Float64(a / Float64(Float64(-1.0 - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.45e+19) || ~((z <= 4.2e-11))) tmp = x + ((y - z) / (z / a)); else tmp = x + (a / ((-1.0 - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.45e+19], N[Not[LessEqual[z, 4.2e-11]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] / N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a / N[(N[(-1.0 - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+19} \lor \neg \left(z \leq 4.2 \cdot 10^{-11}\right):\\
\;\;\;\;x + \frac{y - z}{\frac{z}{a}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{\frac{-1 - t}{y}}\\
\end{array}
\end{array}
if z < -1.45e19 or 4.1999999999999997e-11 < z Initial program 96.7%
Taylor expanded in z around inf 86.2%
associate-*r/86.2%
neg-mul-186.2%
Simplified86.2%
if -1.45e19 < z < 4.1999999999999997e-11Initial program 99.1%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 88.9%
Final simplification87.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e+71) (not (<= z 4.2e-11))) (- x a) (+ x (/ a (/ (- -1.0 t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e+71) || !(z <= 4.2e-11)) {
tmp = x - a;
} else {
tmp = x + (a / ((-1.0 - t) / 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.75d+71)) .or. (.not. (z <= 4.2d-11))) then
tmp = x - a
else
tmp = x + (a / (((-1.0d0) - t) / 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.75e+71) || !(z <= 4.2e-11)) {
tmp = x - a;
} else {
tmp = x + (a / ((-1.0 - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e+71) or not (z <= 4.2e-11): tmp = x - a else: tmp = x + (a / ((-1.0 - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e+71) || !(z <= 4.2e-11)) tmp = Float64(x - a); else tmp = Float64(x + Float64(a / Float64(Float64(-1.0 - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.75e+71) || ~((z <= 4.2e-11))) tmp = x - a; else tmp = x + (a / ((-1.0 - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e+71], N[Not[LessEqual[z, 4.2e-11]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x + N[(a / N[(N[(-1.0 - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+71} \lor \neg \left(z \leq 4.2 \cdot 10^{-11}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + \frac{a}{\frac{-1 - t}{y}}\\
\end{array}
\end{array}
if z < -1.75e71 or 4.1999999999999997e-11 < z Initial program 96.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.3%
if -1.75e71 < z < 4.1999999999999997e-11Initial program 99.2%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 87.3%
Final simplification84.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.22e+72) (not (<= z 4.2e-11))) (- x a) (+ x (* y (/ a (- -1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.22e+72) || !(z <= 4.2e-11)) {
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 <= (-1.22d+72)) .or. (.not. (z <= 4.2d-11))) 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 <= -1.22e+72) || !(z <= 4.2e-11)) {
tmp = x - a;
} else {
tmp = x + (y * (a / (-1.0 - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.22e+72) or not (z <= 4.2e-11): 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 <= -1.22e+72) || !(z <= 4.2e-11)) 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 <= -1.22e+72) || ~((z <= 4.2e-11))) 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, -1.22e+72], N[Not[LessEqual[z, 4.2e-11]], $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 -1.22 \cdot 10^{+72} \lor \neg \left(z \leq 4.2 \cdot 10^{-11}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{a}{-1 - t}\\
\end{array}
\end{array}
if z < -1.2200000000000001e72 or 4.1999999999999997e-11 < z Initial program 96.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 81.3%
if -1.2200000000000001e72 < z < 4.1999999999999997e-11Initial program 99.2%
associate-/r/99.9%
Simplified99.9%
*-commutative99.9%
clear-num99.8%
un-div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 87.3%
associate-/r/86.7%
Applied egg-rr86.7%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.75e+58) (not (<= z 3.5e-14))) (- x a) (- x (* y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.75e+58) || !(z <= 3.5e-14)) {
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 <= (-1.75d+58)) .or. (.not. (z <= 3.5d-14))) 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 <= -1.75e+58) || !(z <= 3.5e-14)) {
tmp = x - a;
} else {
tmp = x - (y * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.75e+58) or not (z <= 3.5e-14): tmp = x - a else: tmp = x - (y * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.75e+58) || !(z <= 3.5e-14)) 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 <= -1.75e+58) || ~((z <= 3.5e-14))) tmp = x - a; else tmp = x - (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.75e+58], N[Not[LessEqual[z, 3.5e-14]], $MachinePrecision]], N[(x - a), $MachinePrecision], N[(x - N[(y * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+58} \lor \neg \left(z \leq 3.5 \cdot 10^{-14}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot a\\
\end{array}
\end{array}
if z < -1.7499999999999999e58 or 3.5000000000000002e-14 < z Initial program 96.6%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 79.9%
if -1.7499999999999999e58 < z < 3.5000000000000002e-14Initial program 99.2%
Taylor expanded in t around 0 75.8%
Taylor expanded in z around 0 66.9%
Final simplification72.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.0021) (not (<= z 6.8e-15))) (- x a) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.0021) || !(z <= 6.8e-15)) {
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 <= (-0.0021d0)) .or. (.not. (z <= 6.8d-15))) 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 <= -0.0021) || !(z <= 6.8e-15)) {
tmp = x - a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.0021) or not (z <= 6.8e-15): tmp = x - a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.0021) || !(z <= 6.8e-15)) 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 <= -0.0021) || ~((z <= 6.8e-15))) tmp = x - a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.0021], N[Not[LessEqual[z, 6.8e-15]], $MachinePrecision]], N[(x - a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.0021 \lor \neg \left(z \leq 6.8 \cdot 10^{-15}\right):\\
\;\;\;\;x - a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -0.00209999999999999987 or 6.8000000000000001e-15 < z Initial program 96.9%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 77.3%
if -0.00209999999999999987 < z < 6.8000000000000001e-15Initial program 99.1%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 53.2%
Final simplification65.1%
(FPCore (x y z t a) :precision binary64 (if (<= x -4.5e-156) x (if (<= x 5.5e-165) (- a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.5e-156) {
tmp = x;
} else if (x <= 5.5e-165) {
tmp = -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 <= (-4.5d-156)) then
tmp = x
else if (x <= 5.5d-165) then
tmp = -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 <= -4.5e-156) {
tmp = x;
} else if (x <= 5.5e-165) {
tmp = -a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -4.5e-156: tmp = x elif x <= 5.5e-165: tmp = -a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -4.5e-156) tmp = x; elseif (x <= 5.5e-165) tmp = Float64(-a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -4.5e-156) tmp = x; elseif (x <= 5.5e-165) tmp = -a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -4.5e-156], x, If[LessEqual[x, 5.5e-165], (-a), x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{-156}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-165}:\\
\;\;\;\;-a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.49999999999999986e-156 or 5.49999999999999969e-165 < x Initial program 99.4%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 67.2%
if -4.49999999999999986e-156 < x < 5.49999999999999969e-165Initial program 93.2%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in z around inf 36.6%
Taylor expanded in x around 0 30.6%
neg-mul-130.6%
Simplified30.6%
(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 98.0%
associate-/r/99.9%
Simplified99.9%
Taylor expanded in x around inf 55.7%
(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 2024144
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.SparkLine:renderSparkLine from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (- x (* (/ (- y z) (+ (- t z) 1)) a)))
(- x (/ (- y z) (/ (+ (- t z) 1.0) a))))