
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (+ x (/ y (/ (- z a) (- t))))))
(if (<= t_1 -1e+18)
t_2
(if (<= t_1 0.01)
(+ x (/ (- t z) (/ a y)))
(if (<= t_1 100000000.0) (+ x (/ y (/ z (- z t)))) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = x + (y / ((z - a) / -t));
double tmp;
if (t_1 <= -1e+18) {
tmp = t_2;
} else if (t_1 <= 0.01) {
tmp = x + ((t - z) / (a / y));
} else if (t_1 <= 100000000.0) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z - t) / (z - a)
t_2 = x + (y / ((z - a) / -t))
if (t_1 <= (-1d+18)) then
tmp = t_2
else if (t_1 <= 0.01d0) then
tmp = x + ((t - z) / (a / y))
else if (t_1 <= 100000000.0d0) then
tmp = x + (y / (z / (z - t)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = x + (y / ((z - a) / -t));
double tmp;
if (t_1 <= -1e+18) {
tmp = t_2;
} else if (t_1 <= 0.01) {
tmp = x + ((t - z) / (a / y));
} else if (t_1 <= 100000000.0) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = x + (y / ((z - a) / -t)) tmp = 0 if t_1 <= -1e+18: tmp = t_2 elif t_1 <= 0.01: tmp = x + ((t - z) / (a / y)) elif t_1 <= 100000000.0: tmp = x + (y / (z / (z - t))) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(x + Float64(y / Float64(Float64(z - a) / Float64(-t)))) tmp = 0.0 if (t_1 <= -1e+18) tmp = t_2; elseif (t_1 <= 0.01) tmp = Float64(x + Float64(Float64(t - z) / Float64(a / y))); elseif (t_1 <= 100000000.0) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = x + (y / ((z - a) / -t)); tmp = 0.0; if (t_1 <= -1e+18) tmp = t_2; elseif (t_1 <= 0.01) tmp = x + ((t - z) / (a / y)); elseif (t_1 <= 100000000.0) tmp = x + (y / (z / (z - t))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+18], t$95$2, If[LessEqual[t$95$1, 0.01], N[(x + N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 100000000.0], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := x + \frac{y}{\frac{z - a}{-t}}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 0.01:\\
\;\;\;\;x + \frac{t - z}{\frac{a}{y}}\\
\mathbf{elif}\;t_1 \leq 100000000:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18 or 1e8 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.1%
Taylor expanded in t around inf 97.3%
associate-*r/97.3%
mul-1-neg97.3%
distribute-lft-neg-out97.3%
*-commutative97.3%
associate-/l*98.2%
Simplified98.2%
if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.0100000000000000002Initial program 97.1%
Taylor expanded in a around inf 90.0%
mul-1-neg90.0%
unsub-neg90.0%
associate-/l*93.7%
associate-/r/96.9%
Simplified96.9%
*-commutative96.9%
clear-num96.9%
un-div-inv97.9%
Applied egg-rr97.9%
if 0.0100000000000000002 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e8Initial program 99.9%
Taylor expanded in a around 0 77.1%
+-commutative77.1%
associate-/l*99.4%
Simplified99.4%
Final simplification98.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -1e+127)
(* y t_1)
(if (<= t_1 -1e+18)
(+ x (/ y (/ (- z) t)))
(if (<= t_1 0.002)
(+ x (/ t (/ a y)))
(if (<= t_1 2e+15)
(+ x (/ y (/ z (- z t))))
(if (<= t_1 1e+137) (+ x (* y (/ t a))) (- x (* t (/ y z))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+127) {
tmp = y * t_1;
} else if (t_1 <= -1e+18) {
tmp = x + (y / (-z / t));
} else if (t_1 <= 0.002) {
tmp = x + (t / (a / y));
} else if (t_1 <= 2e+15) {
tmp = x + (y / (z / (z - t)));
} else if (t_1 <= 1e+137) {
tmp = x + (y * (t / a));
} else {
tmp = x - (t * (y / 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 = (z - t) / (z - a)
if (t_1 <= (-1d+127)) then
tmp = y * t_1
else if (t_1 <= (-1d+18)) then
tmp = x + (y / (-z / t))
else if (t_1 <= 0.002d0) then
tmp = x + (t / (a / y))
else if (t_1 <= 2d+15) then
tmp = x + (y / (z / (z - t)))
else if (t_1 <= 1d+137) then
tmp = x + (y * (t / a))
else
tmp = x - (t * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+127) {
tmp = y * t_1;
} else if (t_1 <= -1e+18) {
tmp = x + (y / (-z / t));
} else if (t_1 <= 0.002) {
tmp = x + (t / (a / y));
} else if (t_1 <= 2e+15) {
tmp = x + (y / (z / (z - t)));
} else if (t_1 <= 1e+137) {
tmp = x + (y * (t / a));
} else {
tmp = x - (t * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -1e+127: tmp = y * t_1 elif t_1 <= -1e+18: tmp = x + (y / (-z / t)) elif t_1 <= 0.002: tmp = x + (t / (a / y)) elif t_1 <= 2e+15: tmp = x + (y / (z / (z - t))) elif t_1 <= 1e+137: tmp = x + (y * (t / a)) else: tmp = x - (t * (y / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -1e+127) tmp = Float64(y * t_1); elseif (t_1 <= -1e+18) tmp = Float64(x + Float64(y / Float64(Float64(-z) / t))); elseif (t_1 <= 0.002) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (t_1 <= 2e+15) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (t_1 <= 1e+137) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x - Float64(t * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -1e+127) tmp = y * t_1; elseif (t_1 <= -1e+18) tmp = x + (y / (-z / t)); elseif (t_1 <= 0.002) tmp = x + (t / (a / y)); elseif (t_1 <= 2e+15) tmp = x + (y / (z / (z - t))); elseif (t_1 <= 1e+137) tmp = x + (y * (t / a)); else tmp = x - (t * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+127], N[(y * t$95$1), $MachinePrecision], If[LessEqual[t$95$1, -1e+18], N[(x + N[(y / N[((-z) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.002], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+15], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+137], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+127}:\\
\;\;\;\;y \cdot t_1\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{-z}{t}}\\
\mathbf{elif}\;t_1 \leq 0.002:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+15}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;t_1 \leq 10^{+137}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999955e126Initial program 99.7%
associate-*r/95.0%
Simplified95.0%
associate-*r/99.7%
*-commutative99.7%
div-inv99.5%
associate-*l*99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 95.0%
div-sub95.0%
Simplified95.0%
if -9.99999999999999955e126 < (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18Initial program 99.9%
Taylor expanded in a around 0 85.3%
+-commutative85.3%
associate-/l*85.3%
Simplified85.3%
Taylor expanded in z around 0 85.3%
associate-*r/85.3%
neg-mul-185.3%
Simplified85.3%
if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2e-3Initial program 97.1%
Taylor expanded in z around 0 85.8%
+-commutative85.8%
associate-/l*89.1%
Simplified89.1%
if 2e-3 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2e15Initial program 99.9%
Taylor expanded in a around 0 76.9%
+-commutative76.9%
associate-/l*98.6%
Simplified98.6%
if 2e15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e137Initial program 99.8%
Taylor expanded in z around 0 69.0%
+-commutative69.0%
associate-/l*56.1%
associate-/r/75.1%
Simplified75.1%
if 1e137 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 87.5%
Taylor expanded in a around 0 87.2%
+-commutative87.2%
associate-/l*79.8%
associate-/r/87.4%
Simplified87.4%
Taylor expanded in z around 0 87.2%
associate-*r/87.2%
mul-1-neg87.2%
distribute-rgt-neg-in87.2%
Simplified87.2%
Taylor expanded in t around 0 87.2%
mul-1-neg87.2%
associate-*r/87.4%
distribute-lft-neg-out87.4%
cancel-sign-sub-inv87.4%
Simplified87.4%
Final simplification92.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -1e+127)
(* y t_1)
(if (<= t_1 -1e+18)
(+ x (/ y (/ (- z) t)))
(if (<= t_1 0.01)
(+ x (* (/ y a) (- t z)))
(if (<= t_1 2e+15)
(+ x (/ y (/ z (- z t))))
(if (<= t_1 1e+137) (+ x (* y (/ t a))) (- x (* t (/ y z))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+127) {
tmp = y * t_1;
} else if (t_1 <= -1e+18) {
tmp = x + (y / (-z / t));
} else if (t_1 <= 0.01) {
tmp = x + ((y / a) * (t - z));
} else if (t_1 <= 2e+15) {
tmp = x + (y / (z / (z - t)));
} else if (t_1 <= 1e+137) {
tmp = x + (y * (t / a));
} else {
tmp = x - (t * (y / 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 = (z - t) / (z - a)
if (t_1 <= (-1d+127)) then
tmp = y * t_1
else if (t_1 <= (-1d+18)) then
tmp = x + (y / (-z / t))
else if (t_1 <= 0.01d0) then
tmp = x + ((y / a) * (t - z))
else if (t_1 <= 2d+15) then
tmp = x + (y / (z / (z - t)))
else if (t_1 <= 1d+137) then
tmp = x + (y * (t / a))
else
tmp = x - (t * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+127) {
tmp = y * t_1;
} else if (t_1 <= -1e+18) {
tmp = x + (y / (-z / t));
} else if (t_1 <= 0.01) {
tmp = x + ((y / a) * (t - z));
} else if (t_1 <= 2e+15) {
tmp = x + (y / (z / (z - t)));
} else if (t_1 <= 1e+137) {
tmp = x + (y * (t / a));
} else {
tmp = x - (t * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -1e+127: tmp = y * t_1 elif t_1 <= -1e+18: tmp = x + (y / (-z / t)) elif t_1 <= 0.01: tmp = x + ((y / a) * (t - z)) elif t_1 <= 2e+15: tmp = x + (y / (z / (z - t))) elif t_1 <= 1e+137: tmp = x + (y * (t / a)) else: tmp = x - (t * (y / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -1e+127) tmp = Float64(y * t_1); elseif (t_1 <= -1e+18) tmp = Float64(x + Float64(y / Float64(Float64(-z) / t))); elseif (t_1 <= 0.01) tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); elseif (t_1 <= 2e+15) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (t_1 <= 1e+137) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x - Float64(t * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -1e+127) tmp = y * t_1; elseif (t_1 <= -1e+18) tmp = x + (y / (-z / t)); elseif (t_1 <= 0.01) tmp = x + ((y / a) * (t - z)); elseif (t_1 <= 2e+15) tmp = x + (y / (z / (z - t))); elseif (t_1 <= 1e+137) tmp = x + (y * (t / a)); else tmp = x - (t * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+127], N[(y * t$95$1), $MachinePrecision], If[LessEqual[t$95$1, -1e+18], N[(x + N[(y / N[((-z) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.01], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+15], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+137], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+127}:\\
\;\;\;\;y \cdot t_1\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{-z}{t}}\\
\mathbf{elif}\;t_1 \leq 0.01:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+15}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;t_1 \leq 10^{+137}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999955e126Initial program 99.7%
associate-*r/95.0%
Simplified95.0%
associate-*r/99.7%
*-commutative99.7%
div-inv99.5%
associate-*l*99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 95.0%
div-sub95.0%
Simplified95.0%
if -9.99999999999999955e126 < (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18Initial program 99.9%
Taylor expanded in a around 0 85.3%
+-commutative85.3%
associate-/l*85.3%
Simplified85.3%
Taylor expanded in z around 0 85.3%
associate-*r/85.3%
neg-mul-185.3%
Simplified85.3%
if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.0100000000000000002Initial program 97.1%
Taylor expanded in a around inf 90.0%
mul-1-neg90.0%
unsub-neg90.0%
associate-/l*93.7%
associate-/r/96.9%
Simplified96.9%
if 0.0100000000000000002 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2e15Initial program 99.9%
Taylor expanded in a around 0 77.6%
+-commutative77.6%
associate-/l*99.4%
Simplified99.4%
if 2e15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e137Initial program 99.8%
Taylor expanded in z around 0 69.0%
+-commutative69.0%
associate-/l*56.1%
associate-/r/75.1%
Simplified75.1%
if 1e137 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 87.5%
Taylor expanded in a around 0 87.2%
+-commutative87.2%
associate-/l*79.8%
associate-/r/87.4%
Simplified87.4%
Taylor expanded in z around 0 87.2%
associate-*r/87.2%
mul-1-neg87.2%
distribute-rgt-neg-in87.2%
Simplified87.2%
Taylor expanded in t around 0 87.2%
mul-1-neg87.2%
associate-*r/87.4%
distribute-lft-neg-out87.4%
cancel-sign-sub-inv87.4%
Simplified87.4%
Final simplification94.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -1e+127)
(* y t_1)
(if (<= t_1 -1e+18)
(+ x (/ y (/ (- z) t)))
(if (<= t_1 0.01)
(+ x (/ (- t z) (/ a y)))
(if (<= t_1 2e+15)
(+ x (/ y (/ z (- z t))))
(if (<= t_1 1e+137) (+ x (* y (/ t a))) (- x (* t (/ y z))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+127) {
tmp = y * t_1;
} else if (t_1 <= -1e+18) {
tmp = x + (y / (-z / t));
} else if (t_1 <= 0.01) {
tmp = x + ((t - z) / (a / y));
} else if (t_1 <= 2e+15) {
tmp = x + (y / (z / (z - t)));
} else if (t_1 <= 1e+137) {
tmp = x + (y * (t / a));
} else {
tmp = x - (t * (y / 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 = (z - t) / (z - a)
if (t_1 <= (-1d+127)) then
tmp = y * t_1
else if (t_1 <= (-1d+18)) then
tmp = x + (y / (-z / t))
else if (t_1 <= 0.01d0) then
tmp = x + ((t - z) / (a / y))
else if (t_1 <= 2d+15) then
tmp = x + (y / (z / (z - t)))
else if (t_1 <= 1d+137) then
tmp = x + (y * (t / a))
else
tmp = x - (t * (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+127) {
tmp = y * t_1;
} else if (t_1 <= -1e+18) {
tmp = x + (y / (-z / t));
} else if (t_1 <= 0.01) {
tmp = x + ((t - z) / (a / y));
} else if (t_1 <= 2e+15) {
tmp = x + (y / (z / (z - t)));
} else if (t_1 <= 1e+137) {
tmp = x + (y * (t / a));
} else {
tmp = x - (t * (y / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -1e+127: tmp = y * t_1 elif t_1 <= -1e+18: tmp = x + (y / (-z / t)) elif t_1 <= 0.01: tmp = x + ((t - z) / (a / y)) elif t_1 <= 2e+15: tmp = x + (y / (z / (z - t))) elif t_1 <= 1e+137: tmp = x + (y * (t / a)) else: tmp = x - (t * (y / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -1e+127) tmp = Float64(y * t_1); elseif (t_1 <= -1e+18) tmp = Float64(x + Float64(y / Float64(Float64(-z) / t))); elseif (t_1 <= 0.01) tmp = Float64(x + Float64(Float64(t - z) / Float64(a / y))); elseif (t_1 <= 2e+15) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (t_1 <= 1e+137) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x - Float64(t * Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -1e+127) tmp = y * t_1; elseif (t_1 <= -1e+18) tmp = x + (y / (-z / t)); elseif (t_1 <= 0.01) tmp = x + ((t - z) / (a / y)); elseif (t_1 <= 2e+15) tmp = x + (y / (z / (z - t))); elseif (t_1 <= 1e+137) tmp = x + (y * (t / a)); else tmp = x - (t * (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+127], N[(y * t$95$1), $MachinePrecision], If[LessEqual[t$95$1, -1e+18], N[(x + N[(y / N[((-z) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.01], N[(x + N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+15], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+137], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+127}:\\
\;\;\;\;y \cdot t_1\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{-z}{t}}\\
\mathbf{elif}\;t_1 \leq 0.01:\\
\;\;\;\;x + \frac{t - z}{\frac{a}{y}}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+15}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;t_1 \leq 10^{+137}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999955e126Initial program 99.7%
associate-*r/95.0%
Simplified95.0%
associate-*r/99.7%
*-commutative99.7%
div-inv99.5%
associate-*l*99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 95.0%
div-sub95.0%
Simplified95.0%
if -9.99999999999999955e126 < (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18Initial program 99.9%
Taylor expanded in a around 0 85.3%
+-commutative85.3%
associate-/l*85.3%
Simplified85.3%
Taylor expanded in z around 0 85.3%
associate-*r/85.3%
neg-mul-185.3%
Simplified85.3%
if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 0.0100000000000000002Initial program 97.1%
Taylor expanded in a around inf 90.0%
mul-1-neg90.0%
unsub-neg90.0%
associate-/l*93.7%
associate-/r/96.9%
Simplified96.9%
*-commutative96.9%
clear-num96.9%
un-div-inv97.9%
Applied egg-rr97.9%
if 0.0100000000000000002 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2e15Initial program 99.9%
Taylor expanded in a around 0 77.6%
+-commutative77.6%
associate-/l*99.4%
Simplified99.4%
if 2e15 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1e137Initial program 99.8%
Taylor expanded in z around 0 69.0%
+-commutative69.0%
associate-/l*56.1%
associate-/r/75.1%
Simplified75.1%
if 1e137 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 87.5%
Taylor expanded in a around 0 87.2%
+-commutative87.2%
associate-/l*79.8%
associate-/r/87.4%
Simplified87.4%
Taylor expanded in z around 0 87.2%
associate-*r/87.2%
mul-1-neg87.2%
distribute-rgt-neg-in87.2%
Simplified87.2%
Taylor expanded in t around 0 87.2%
mul-1-neg87.2%
associate-*r/87.4%
distribute-lft-neg-out87.4%
cancel-sign-sub-inv87.4%
Simplified87.4%
Final simplification95.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (* y t_1)))
(if (<= t_1 -1e+127)
t_2
(if (<= t_1 -1e+18)
(+ x (/ y (/ (- z) t)))
(if (<= t_1 2e-17)
(+ x (/ t (/ a y)))
(if (<= t_1 1e+35) (+ x y) t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = y * t_1;
double tmp;
if (t_1 <= -1e+127) {
tmp = t_2;
} else if (t_1 <= -1e+18) {
tmp = x + (y / (-z / t));
} else if (t_1 <= 2e-17) {
tmp = x + (t / (a / y));
} else if (t_1 <= 1e+35) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z - t) / (z - a)
t_2 = y * t_1
if (t_1 <= (-1d+127)) then
tmp = t_2
else if (t_1 <= (-1d+18)) then
tmp = x + (y / (-z / t))
else if (t_1 <= 2d-17) then
tmp = x + (t / (a / y))
else if (t_1 <= 1d+35) then
tmp = x + y
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = y * t_1;
double tmp;
if (t_1 <= -1e+127) {
tmp = t_2;
} else if (t_1 <= -1e+18) {
tmp = x + (y / (-z / t));
} else if (t_1 <= 2e-17) {
tmp = x + (t / (a / y));
} else if (t_1 <= 1e+35) {
tmp = x + y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = y * t_1 tmp = 0 if t_1 <= -1e+127: tmp = t_2 elif t_1 <= -1e+18: tmp = x + (y / (-z / t)) elif t_1 <= 2e-17: tmp = x + (t / (a / y)) elif t_1 <= 1e+35: tmp = x + y else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(y * t_1) tmp = 0.0 if (t_1 <= -1e+127) tmp = t_2; elseif (t_1 <= -1e+18) tmp = Float64(x + Float64(y / Float64(Float64(-z) / t))); elseif (t_1 <= 2e-17) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (t_1 <= 1e+35) tmp = Float64(x + y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = y * t_1; tmp = 0.0; if (t_1 <= -1e+127) tmp = t_2; elseif (t_1 <= -1e+18) tmp = x + (y / (-z / t)); elseif (t_1 <= 2e-17) tmp = x + (t / (a / y)); elseif (t_1 <= 1e+35) tmp = x + y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+127], t$95$2, If[LessEqual[t$95$1, -1e+18], N[(x + N[(y / N[((-z) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-17], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+35], N[(x + y), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := y \cdot t_1\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+127}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{-z}{t}}\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;t_1 \leq 10^{+35}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999955e126 or 9.9999999999999997e34 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 95.4%
associate-*r/95.8%
Simplified95.8%
associate-*r/95.4%
*-commutative95.4%
div-inv95.2%
associate-*l*93.7%
Applied egg-rr93.7%
Taylor expanded in y around inf 84.1%
div-sub84.1%
Simplified84.1%
if -9.99999999999999955e126 < (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18Initial program 99.9%
Taylor expanded in a around 0 85.3%
+-commutative85.3%
associate-/l*85.3%
Simplified85.3%
Taylor expanded in z around 0 85.3%
associate-*r/85.3%
neg-mul-185.3%
Simplified85.3%
if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.00000000000000014e-17Initial program 97.0%
Taylor expanded in z around 0 85.3%
+-commutative85.3%
associate-/l*88.7%
Simplified88.7%
if 2.00000000000000014e-17 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999997e34Initial program 99.9%
Taylor expanded in z around inf 94.3%
+-commutative94.3%
Simplified94.3%
Final simplification89.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (* y t_1)))
(if (<= t_1 -1e+127)
t_2
(if (<= t_1 -1e+18)
(+ x (/ y (/ (- z) t)))
(if (<= t_1 1e+35) (+ x (* y (/ z (- z a)))) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = y * t_1;
double tmp;
if (t_1 <= -1e+127) {
tmp = t_2;
} else if (t_1 <= -1e+18) {
tmp = x + (y / (-z / t));
} else if (t_1 <= 1e+35) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z - t) / (z - a)
t_2 = y * t_1
if (t_1 <= (-1d+127)) then
tmp = t_2
else if (t_1 <= (-1d+18)) then
tmp = x + (y / (-z / t))
else if (t_1 <= 1d+35) then
tmp = x + (y * (z / (z - a)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = y * t_1;
double tmp;
if (t_1 <= -1e+127) {
tmp = t_2;
} else if (t_1 <= -1e+18) {
tmp = x + (y / (-z / t));
} else if (t_1 <= 1e+35) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) t_2 = y * t_1 tmp = 0 if t_1 <= -1e+127: tmp = t_2 elif t_1 <= -1e+18: tmp = x + (y / (-z / t)) elif t_1 <= 1e+35: tmp = x + (y * (z / (z - a))) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(y * t_1) tmp = 0.0 if (t_1 <= -1e+127) tmp = t_2; elseif (t_1 <= -1e+18) tmp = Float64(x + Float64(y / Float64(Float64(-z) / t))); elseif (t_1 <= 1e+35) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); t_2 = y * t_1; tmp = 0.0; if (t_1 <= -1e+127) tmp = t_2; elseif (t_1 <= -1e+18) tmp = x + (y / (-z / t)); elseif (t_1 <= 1e+35) tmp = x + (y * (z / (z - a))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * t$95$1), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+127], t$95$2, If[LessEqual[t$95$1, -1e+18], N[(x + N[(y / N[((-z) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+35], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := y \cdot t_1\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+127}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{-z}{t}}\\
\mathbf{elif}\;t_1 \leq 10^{+35}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999955e126 or 9.9999999999999997e34 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 95.4%
associate-*r/95.8%
Simplified95.8%
associate-*r/95.4%
*-commutative95.4%
div-inv95.2%
associate-*l*93.7%
Applied egg-rr93.7%
Taylor expanded in y around inf 84.1%
div-sub84.1%
Simplified84.1%
if -9.99999999999999955e126 < (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18Initial program 99.9%
Taylor expanded in a around 0 85.3%
+-commutative85.3%
associate-/l*85.3%
Simplified85.3%
Taylor expanded in z around 0 85.3%
associate-*r/85.3%
neg-mul-185.3%
Simplified85.3%
if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 9.9999999999999997e34Initial program 98.7%
Taylor expanded in t around 0 90.5%
Final simplification88.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -1e+127)
(* y t_1)
(if (<= t_1 -1e+18)
(+ x (/ y (/ (- z) t)))
(if (<= t_1 1.0000000005)
(+ x (* y (/ z (- z a))))
(+ x (/ (* y (- z t)) z)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+127) {
tmp = y * t_1;
} else if (t_1 <= -1e+18) {
tmp = x + (y / (-z / t));
} else if (t_1 <= 1.0000000005) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + ((y * (z - 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 = (z - t) / (z - a)
if (t_1 <= (-1d+127)) then
tmp = y * t_1
else if (t_1 <= (-1d+18)) then
tmp = x + (y / (-z / t))
else if (t_1 <= 1.0000000005d0) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + ((y * (z - 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 = (z - t) / (z - a);
double tmp;
if (t_1 <= -1e+127) {
tmp = y * t_1;
} else if (t_1 <= -1e+18) {
tmp = x + (y / (-z / t));
} else if (t_1 <= 1.0000000005) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + ((y * (z - t)) / z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= -1e+127: tmp = y * t_1 elif t_1 <= -1e+18: tmp = x + (y / (-z / t)) elif t_1 <= 1.0000000005: tmp = x + (y * (z / (z - a))) else: tmp = x + ((y * (z - t)) / z) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -1e+127) tmp = Float64(y * t_1); elseif (t_1 <= -1e+18) tmp = Float64(x + Float64(y / Float64(Float64(-z) / t))); elseif (t_1 <= 1.0000000005) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= -1e+127) tmp = y * t_1; elseif (t_1 <= -1e+18) tmp = x + (y / (-z / t)); elseif (t_1 <= 1.0000000005) tmp = x + (y * (z / (z - a))); else tmp = x + ((y * (z - t)) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+127], N[(y * t$95$1), $MachinePrecision], If[LessEqual[t$95$1, -1e+18], N[(x + N[(y / N[((-z) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.0000000005], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+127}:\\
\;\;\;\;y \cdot t_1\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{+18}:\\
\;\;\;\;x + \frac{y}{\frac{-z}{t}}\\
\mathbf{elif}\;t_1 \leq 1.0000000005:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.99999999999999955e126Initial program 99.7%
associate-*r/95.0%
Simplified95.0%
associate-*r/99.7%
*-commutative99.7%
div-inv99.5%
associate-*l*99.9%
Applied egg-rr99.9%
Taylor expanded in y around inf 95.0%
div-sub95.0%
Simplified95.0%
if -9.99999999999999955e126 < (/.f64 (-.f64 z t) (-.f64 z a)) < -1e18Initial program 99.9%
Taylor expanded in a around 0 85.3%
+-commutative85.3%
associate-/l*85.3%
Simplified85.3%
Taylor expanded in z around 0 85.3%
associate-*r/85.3%
neg-mul-185.3%
Simplified85.3%
if -1e18 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.0000000005Initial program 98.6%
Taylor expanded in t around 0 92.3%
if 1.0000000005 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 95.2%
Taylor expanded in a around 0 74.9%
Final simplification89.0%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.8e+81)
(+ x y)
(if (<= z -6.5e+42)
(* y (- 1.0 (/ t z)))
(if (<= z 7.8e-56) (+ x (/ (* y t) a)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.8e+81) {
tmp = x + y;
} else if (z <= -6.5e+42) {
tmp = y * (1.0 - (t / z));
} else if (z <= 7.8e-56) {
tmp = x + ((y * t) / a);
} else {
tmp = x + 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.8d+81)) then
tmp = x + y
else if (z <= (-6.5d+42)) then
tmp = y * (1.0d0 - (t / z))
else if (z <= 7.8d-56) then
tmp = x + ((y * t) / a)
else
tmp = x + 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.8e+81) {
tmp = x + y;
} else if (z <= -6.5e+42) {
tmp = y * (1.0 - (t / z));
} else if (z <= 7.8e-56) {
tmp = x + ((y * t) / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.8e+81: tmp = x + y elif z <= -6.5e+42: tmp = y * (1.0 - (t / z)) elif z <= 7.8e-56: tmp = x + ((y * t) / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.8e+81) tmp = Float64(x + y); elseif (z <= -6.5e+42) tmp = Float64(y * Float64(1.0 - Float64(t / z))); elseif (z <= 7.8e-56) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.8e+81) tmp = x + y; elseif (z <= -6.5e+42) tmp = y * (1.0 - (t / z)); elseif (z <= 7.8e-56) tmp = x + ((y * t) / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.8e+81], N[(x + y), $MachinePrecision], If[LessEqual[z, -6.5e+42], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e-56], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+81}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{+42}:\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-56}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.80000000000000003e81 or 7.8e-56 < z Initial program 99.9%
Taylor expanded in z around inf 80.7%
+-commutative80.7%
Simplified80.7%
if -1.80000000000000003e81 < z < -6.50000000000000052e42Initial program 99.8%
Taylor expanded in a around 0 99.8%
+-commutative99.8%
associate-/l*99.7%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in y around inf 88.7%
if -6.50000000000000052e42 < z < 7.8e-56Initial program 96.3%
Taylor expanded in z around 0 76.4%
Final simplification78.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -7.2e+82)
(+ x y)
(if (<= z -7.2e+42)
(* y (- 1.0 (/ t z)))
(if (<= z 3.7e-53) (+ x (* y (/ t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.2e+82) {
tmp = x + y;
} else if (z <= -7.2e+42) {
tmp = y * (1.0 - (t / z));
} else if (z <= 3.7e-53) {
tmp = x + (y * (t / a));
} else {
tmp = x + 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 <= (-7.2d+82)) then
tmp = x + y
else if (z <= (-7.2d+42)) then
tmp = y * (1.0d0 - (t / z))
else if (z <= 3.7d-53) then
tmp = x + (y * (t / a))
else
tmp = x + 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 <= -7.2e+82) {
tmp = x + y;
} else if (z <= -7.2e+42) {
tmp = y * (1.0 - (t / z));
} else if (z <= 3.7e-53) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.2e+82: tmp = x + y elif z <= -7.2e+42: tmp = y * (1.0 - (t / z)) elif z <= 3.7e-53: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.2e+82) tmp = Float64(x + y); elseif (z <= -7.2e+42) tmp = Float64(y * Float64(1.0 - Float64(t / z))); elseif (z <= 3.7e-53) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.2e+82) tmp = x + y; elseif (z <= -7.2e+42) tmp = y * (1.0 - (t / z)); elseif (z <= 3.7e-53) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.2e+82], N[(x + y), $MachinePrecision], If[LessEqual[z, -7.2e+42], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e-53], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+82}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{+42}:\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-53}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -7.20000000000000028e82 or 3.69999999999999982e-53 < z Initial program 99.9%
Taylor expanded in z around inf 80.7%
+-commutative80.7%
Simplified80.7%
if -7.20000000000000028e82 < z < -7.2000000000000002e42Initial program 99.8%
Taylor expanded in a around 0 99.8%
+-commutative99.8%
associate-/l*99.7%
associate-/r/100.0%
Simplified100.0%
Taylor expanded in y around inf 88.7%
if -7.2000000000000002e42 < z < 3.69999999999999982e-53Initial program 96.3%
Taylor expanded in z around 0 76.4%
+-commutative76.4%
associate-/l*76.4%
associate-/r/77.1%
Simplified77.1%
Final simplification79.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.1e+84)
(+ x y)
(if (<= z -1.8e-63)
(- x (* t (/ y z)))
(if (<= z 5.8e-48) (+ x (* y (/ t a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e+84) {
tmp = x + y;
} else if (z <= -1.8e-63) {
tmp = x - (t * (y / z));
} else if (z <= 5.8e-48) {
tmp = x + (y * (t / a));
} else {
tmp = x + 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 <= (-3.1d+84)) then
tmp = x + y
else if (z <= (-1.8d-63)) then
tmp = x - (t * (y / z))
else if (z <= 5.8d-48) then
tmp = x + (y * (t / a))
else
tmp = x + 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 <= -3.1e+84) {
tmp = x + y;
} else if (z <= -1.8e-63) {
tmp = x - (t * (y / z));
} else if (z <= 5.8e-48) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.1e+84: tmp = x + y elif z <= -1.8e-63: tmp = x - (t * (y / z)) elif z <= 5.8e-48: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e+84) tmp = Float64(x + y); elseif (z <= -1.8e-63) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 5.8e-48) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.1e+84) tmp = x + y; elseif (z <= -1.8e-63) tmp = x - (t * (y / z)); elseif (z <= 5.8e-48) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e+84], N[(x + y), $MachinePrecision], If[LessEqual[z, -1.8e-63], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e-48], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+84}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-63}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-48}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.10000000000000003e84 or 5.8000000000000006e-48 < z Initial program 99.9%
Taylor expanded in z around inf 80.6%
+-commutative80.6%
Simplified80.6%
if -3.10000000000000003e84 < z < -1.80000000000000004e-63Initial program 99.9%
Taylor expanded in a around 0 82.3%
+-commutative82.3%
associate-/l*82.5%
associate-/r/80.0%
Simplified80.0%
Taylor expanded in z around 0 76.6%
associate-*r/76.6%
mul-1-neg76.6%
distribute-rgt-neg-in76.6%
Simplified76.6%
Taylor expanded in t around 0 76.6%
mul-1-neg76.6%
associate-*r/76.9%
distribute-lft-neg-out76.9%
cancel-sign-sub-inv76.9%
Simplified76.9%
if -1.80000000000000004e-63 < z < 5.8000000000000006e-48Initial program 95.4%
Taylor expanded in z around 0 79.4%
+-commutative79.4%
associate-/l*79.4%
associate-/r/80.3%
Simplified80.3%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.7e+173) (not (<= y 6.2e+147))) (* y (- 1.0 (/ t z))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.7e+173) || !(y <= 6.2e+147)) {
tmp = y * (1.0 - (t / z));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-4.7d+173)) .or. (.not. (y <= 6.2d+147))) then
tmp = y * (1.0d0 - (t / z))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.7e+173) || !(y <= 6.2e+147)) {
tmp = y * (1.0 - (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.7e+173) or not (y <= 6.2e+147): tmp = y * (1.0 - (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.7e+173) || !(y <= 6.2e+147)) tmp = Float64(y * Float64(1.0 - Float64(t / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -4.7e+173) || ~((y <= 6.2e+147))) tmp = y * (1.0 - (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.7e+173], N[Not[LessEqual[y, 6.2e+147]], $MachinePrecision]], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.7 \cdot 10^{+173} \lor \neg \left(y \leq 6.2 \cdot 10^{+147}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -4.70000000000000015e173 or 6.2000000000000001e147 < y Initial program 96.8%
Taylor expanded in a around 0 36.9%
+-commutative36.9%
associate-/l*64.9%
associate-/r/59.9%
Simplified59.9%
Taylor expanded in y around inf 63.4%
if -4.70000000000000015e173 < y < 6.2000000000000001e147Initial program 98.6%
Taylor expanded in z around inf 69.3%
+-commutative69.3%
Simplified69.3%
Final simplification67.8%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.2%
Final simplification98.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.5e-38) (not (<= z 1.5e+92))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.5e-38) || !(z <= 1.5e+92)) {
tmp = x + 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 ((z <= (-5.5d-38)) .or. (.not. (z <= 1.5d+92))) then
tmp = x + 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 ((z <= -5.5e-38) || !(z <= 1.5e+92)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.5e-38) or not (z <= 1.5e+92): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.5e-38) || !(z <= 1.5e+92)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.5e-38) || ~((z <= 1.5e+92))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.5e-38], N[Not[LessEqual[z, 1.5e+92]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-38} \lor \neg \left(z \leq 1.5 \cdot 10^{+92}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.50000000000000005e-38 or 1.50000000000000007e92 < z Initial program 99.9%
Taylor expanded in z around inf 78.5%
+-commutative78.5%
Simplified78.5%
if -5.50000000000000005e-38 < z < 1.50000000000000007e92Initial program 96.6%
Taylor expanded in x around inf 56.8%
Final simplification67.1%
(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.2%
Taylor expanded in x around inf 53.1%
Final simplification53.1%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (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 + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2023321
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))