
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - 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 - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ (- z t) (- a t))))) (if (<= t_1 1e+287) (+ x t_1) (+ x (* (/ y (- a t)) z)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t_1 <= 1e+287) {
tmp = x + t_1;
} else {
tmp = x + ((y / (a - t)) * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y * ((z - t) / (a - t))
if (t_1 <= 1d+287) then
tmp = x + t_1
else
tmp = x + ((y / (a - t)) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t_1 <= 1e+287) {
tmp = x + t_1;
} else {
tmp = x + ((y / (a - t)) * z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z - t) / (a - t)) tmp = 0 if t_1 <= 1e+287: tmp = x + t_1 else: tmp = x + ((y / (a - t)) * z) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(a - t))) tmp = 0.0 if (t_1 <= 1e+287) tmp = Float64(x + t_1); else tmp = Float64(x + Float64(Float64(y / Float64(a - t)) * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z - t) / (a - t)); tmp = 0.0; if (t_1 <= 1e+287) tmp = x + t_1; else tmp = x + ((y / (a - t)) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+287], N[(x + t$95$1), $MachinePrecision], N[(x + N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t_1 \leq 10^{+287}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a - t} \cdot z\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < 1.0000000000000001e287Initial program 97.9%
if 1.0000000000000001e287 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) Initial program 71.9%
Taylor expanded in z around inf 99.8%
associate-/l*76.8%
associate-/r/99.8%
Applied egg-rr99.8%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z a)))) (t_2 (- x (* y (/ z t)))))
(if (<= t -9e+138)
(+ x y)
(if (<= t -2.55e-51)
t_2
(if (<= t -9.5e-56)
(+ x y)
(if (<= t 4.2e-100)
(+ x (* z (/ y a)))
(if (<= t 3.6e-59)
t_2
(if (<= t 480000000.0)
t_1
(if (<= t 5.1e+160)
t_2
(if (<= t 8.5e+160) t_1 (+ x y)))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / a));
double t_2 = x - (y * (z / t));
double tmp;
if (t <= -9e+138) {
tmp = x + y;
} else if (t <= -2.55e-51) {
tmp = t_2;
} else if (t <= -9.5e-56) {
tmp = x + y;
} else if (t <= 4.2e-100) {
tmp = x + (z * (y / a));
} else if (t <= 3.6e-59) {
tmp = t_2;
} else if (t <= 480000000.0) {
tmp = t_1;
} else if (t <= 5.1e+160) {
tmp = t_2;
} else if (t <= 8.5e+160) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (y * (z / a))
t_2 = x - (y * (z / t))
if (t <= (-9d+138)) then
tmp = x + y
else if (t <= (-2.55d-51)) then
tmp = t_2
else if (t <= (-9.5d-56)) then
tmp = x + y
else if (t <= 4.2d-100) then
tmp = x + (z * (y / a))
else if (t <= 3.6d-59) then
tmp = t_2
else if (t <= 480000000.0d0) then
tmp = t_1
else if (t <= 5.1d+160) then
tmp = t_2
else if (t <= 8.5d+160) then
tmp = t_1
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 t_1 = x + (y * (z / a));
double t_2 = x - (y * (z / t));
double tmp;
if (t <= -9e+138) {
tmp = x + y;
} else if (t <= -2.55e-51) {
tmp = t_2;
} else if (t <= -9.5e-56) {
tmp = x + y;
} else if (t <= 4.2e-100) {
tmp = x + (z * (y / a));
} else if (t <= 3.6e-59) {
tmp = t_2;
} else if (t <= 480000000.0) {
tmp = t_1;
} else if (t <= 5.1e+160) {
tmp = t_2;
} else if (t <= 8.5e+160) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / a)) t_2 = x - (y * (z / t)) tmp = 0 if t <= -9e+138: tmp = x + y elif t <= -2.55e-51: tmp = t_2 elif t <= -9.5e-56: tmp = x + y elif t <= 4.2e-100: tmp = x + (z * (y / a)) elif t <= 3.6e-59: tmp = t_2 elif t <= 480000000.0: tmp = t_1 elif t <= 5.1e+160: tmp = t_2 elif t <= 8.5e+160: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / a))) t_2 = Float64(x - Float64(y * Float64(z / t))) tmp = 0.0 if (t <= -9e+138) tmp = Float64(x + y); elseif (t <= -2.55e-51) tmp = t_2; elseif (t <= -9.5e-56) tmp = Float64(x + y); elseif (t <= 4.2e-100) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (t <= 3.6e-59) tmp = t_2; elseif (t <= 480000000.0) tmp = t_1; elseif (t <= 5.1e+160) tmp = t_2; elseif (t <= 8.5e+160) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * (z / a)); t_2 = x - (y * (z / t)); tmp = 0.0; if (t <= -9e+138) tmp = x + y; elseif (t <= -2.55e-51) tmp = t_2; elseif (t <= -9.5e-56) tmp = x + y; elseif (t <= 4.2e-100) tmp = x + (z * (y / a)); elseif (t <= 3.6e-59) tmp = t_2; elseif (t <= 480000000.0) tmp = t_1; elseif (t <= 5.1e+160) tmp = t_2; elseif (t <= 8.5e+160) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9e+138], N[(x + y), $MachinePrecision], If[LessEqual[t, -2.55e-51], t$95$2, If[LessEqual[t, -9.5e-56], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.2e-100], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.6e-59], t$95$2, If[LessEqual[t, 480000000.0], t$95$1, If[LessEqual[t, 5.1e+160], t$95$2, If[LessEqual[t, 8.5e+160], t$95$1, N[(x + y), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{a}\\
t_2 := x - y \cdot \frac{z}{t}\\
\mathbf{if}\;t \leq -9 \cdot 10^{+138}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -2.55 \cdot 10^{-51}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -9.5 \cdot 10^{-56}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{-100}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{-59}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 480000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 5.1 \cdot 10^{+160}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+160}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -8.99999999999999963e138 or -2.5499999999999999e-51 < t < -9.4999999999999991e-56 or 8.49999999999999982e160 < t Initial program 99.9%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -8.99999999999999963e138 < t < -2.5499999999999999e-51 or 4.20000000000000019e-100 < t < 3.6e-59 or 4.8e8 < t < 5.1000000000000001e160Initial program 99.9%
Taylor expanded in z around inf 74.5%
Taylor expanded in a around 0 69.3%
+-commutative69.3%
associate-*r/69.3%
mul-1-neg69.3%
distribute-rgt-neg-out69.3%
Simplified69.3%
Taylor expanded in y around 0 69.3%
mul-1-neg69.3%
associate-*r/72.9%
distribute-lft-neg-in72.9%
cancel-sign-sub-inv72.9%
Simplified72.9%
if -9.4999999999999991e-56 < t < 4.20000000000000019e-100Initial program 90.5%
Taylor expanded in t around 0 81.0%
+-commutative81.0%
associate-/l*83.9%
associate-/r/84.6%
Simplified84.6%
if 3.6e-59 < t < 4.8e8 or 5.1000000000000001e160 < t < 8.49999999999999982e160Initial program 99.9%
Taylor expanded in t around 0 74.0%
Final simplification80.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (/ y (/ t z)))) (t_2 (+ x (* y (/ z a)))))
(if (<= t -3.2e+138)
(+ x y)
(if (<= t -1e-51)
(- x (* y (/ z t)))
(if (<= t -4.7e-54)
(+ x y)
(if (<= t 1.8e-100)
(+ x (* z (/ y a)))
(if (<= t 5.2e-60)
t_1
(if (<= t 850000000.0)
t_2
(if (<= t 8.4e+160)
t_1
(if (<= t 8.5e+160) t_2 (+ x y)))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (y / (t / z));
double t_2 = x + (y * (z / a));
double tmp;
if (t <= -3.2e+138) {
tmp = x + y;
} else if (t <= -1e-51) {
tmp = x - (y * (z / t));
} else if (t <= -4.7e-54) {
tmp = x + y;
} else if (t <= 1.8e-100) {
tmp = x + (z * (y / a));
} else if (t <= 5.2e-60) {
tmp = t_1;
} else if (t <= 850000000.0) {
tmp = t_2;
} else if (t <= 8.4e+160) {
tmp = t_1;
} else if (t <= 8.5e+160) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x - (y / (t / z))
t_2 = x + (y * (z / a))
if (t <= (-3.2d+138)) then
tmp = x + y
else if (t <= (-1d-51)) then
tmp = x - (y * (z / t))
else if (t <= (-4.7d-54)) then
tmp = x + y
else if (t <= 1.8d-100) then
tmp = x + (z * (y / a))
else if (t <= 5.2d-60) then
tmp = t_1
else if (t <= 850000000.0d0) then
tmp = t_2
else if (t <= 8.4d+160) then
tmp = t_1
else if (t <= 8.5d+160) then
tmp = t_2
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 t_1 = x - (y / (t / z));
double t_2 = x + (y * (z / a));
double tmp;
if (t <= -3.2e+138) {
tmp = x + y;
} else if (t <= -1e-51) {
tmp = x - (y * (z / t));
} else if (t <= -4.7e-54) {
tmp = x + y;
} else if (t <= 1.8e-100) {
tmp = x + (z * (y / a));
} else if (t <= 5.2e-60) {
tmp = t_1;
} else if (t <= 850000000.0) {
tmp = t_2;
} else if (t <= 8.4e+160) {
tmp = t_1;
} else if (t <= 8.5e+160) {
tmp = t_2;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (y / (t / z)) t_2 = x + (y * (z / a)) tmp = 0 if t <= -3.2e+138: tmp = x + y elif t <= -1e-51: tmp = x - (y * (z / t)) elif t <= -4.7e-54: tmp = x + y elif t <= 1.8e-100: tmp = x + (z * (y / a)) elif t <= 5.2e-60: tmp = t_1 elif t <= 850000000.0: tmp = t_2 elif t <= 8.4e+160: tmp = t_1 elif t <= 8.5e+160: tmp = t_2 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(y / Float64(t / z))) t_2 = Float64(x + Float64(y * Float64(z / a))) tmp = 0.0 if (t <= -3.2e+138) tmp = Float64(x + y); elseif (t <= -1e-51) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= -4.7e-54) tmp = Float64(x + y); elseif (t <= 1.8e-100) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (t <= 5.2e-60) tmp = t_1; elseif (t <= 850000000.0) tmp = t_2; elseif (t <= 8.4e+160) tmp = t_1; elseif (t <= 8.5e+160) tmp = t_2; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (y / (t / z)); t_2 = x + (y * (z / a)); tmp = 0.0; if (t <= -3.2e+138) tmp = x + y; elseif (t <= -1e-51) tmp = x - (y * (z / t)); elseif (t <= -4.7e-54) tmp = x + y; elseif (t <= 1.8e-100) tmp = x + (z * (y / a)); elseif (t <= 5.2e-60) tmp = t_1; elseif (t <= 850000000.0) tmp = t_2; elseif (t <= 8.4e+160) tmp = t_1; elseif (t <= 8.5e+160) tmp = t_2; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.2e+138], N[(x + y), $MachinePrecision], If[LessEqual[t, -1e-51], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.7e-54], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.8e-100], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.2e-60], t$95$1, If[LessEqual[t, 850000000.0], t$95$2, If[LessEqual[t, 8.4e+160], t$95$1, If[LessEqual[t, 8.5e+160], t$95$2, N[(x + y), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \frac{y}{\frac{t}{z}}\\
t_2 := x + y \cdot \frac{z}{a}\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{+138}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -1 \cdot 10^{-51}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq -4.7 \cdot 10^{-54}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-100}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-60}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 850000000:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{+160}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+160}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.2000000000000001e138 or -1e-51 < t < -4.7e-54 or 8.49999999999999982e160 < t Initial program 99.9%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -3.2000000000000001e138 < t < -1e-51Initial program 99.9%
Taylor expanded in z around inf 70.2%
Taylor expanded in a around 0 67.8%
+-commutative67.8%
associate-*r/67.8%
mul-1-neg67.8%
distribute-rgt-neg-out67.8%
Simplified67.8%
Taylor expanded in y around 0 67.8%
mul-1-neg67.8%
associate-*r/70.1%
distribute-lft-neg-in70.1%
cancel-sign-sub-inv70.1%
Simplified70.1%
if -4.7e-54 < t < 1.7999999999999999e-100Initial program 90.5%
Taylor expanded in t around 0 81.0%
+-commutative81.0%
associate-/l*83.9%
associate-/r/84.6%
Simplified84.6%
if 1.7999999999999999e-100 < t < 5.1999999999999995e-60 or 8.5e8 < t < 8.39999999999999987e160Initial program 99.8%
Taylor expanded in z around inf 79.3%
Taylor expanded in a around 0 71.0%
mul-1-neg71.0%
unsub-neg71.0%
associate-/l*76.0%
Simplified76.0%
if 5.1999999999999995e-60 < t < 8.5e8 or 8.39999999999999987e160 < t < 8.49999999999999982e160Initial program 99.9%
Taylor expanded in t around 0 74.0%
Final simplification80.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) a)))))
(if (<= a -1.45e-33)
t_1
(if (<= a -1.9e-117)
(+ x y)
(if (<= a -2.4e-122)
(+ x (* y (/ z a)))
(if (<= a 3.35e-40) (- x (/ (* y z) t)) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / a));
double tmp;
if (a <= -1.45e-33) {
tmp = t_1;
} else if (a <= -1.9e-117) {
tmp = x + y;
} else if (a <= -2.4e-122) {
tmp = x + (y * (z / a));
} else if (a <= 3.35e-40) {
tmp = x - ((y * z) / t);
} 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 * ((z - t) / a))
if (a <= (-1.45d-33)) then
tmp = t_1
else if (a <= (-1.9d-117)) then
tmp = x + y
else if (a <= (-2.4d-122)) then
tmp = x + (y * (z / a))
else if (a <= 3.35d-40) then
tmp = x - ((y * z) / t)
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 * ((z - t) / a));
double tmp;
if (a <= -1.45e-33) {
tmp = t_1;
} else if (a <= -1.9e-117) {
tmp = x + y;
} else if (a <= -2.4e-122) {
tmp = x + (y * (z / a));
} else if (a <= 3.35e-40) {
tmp = x - ((y * z) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / a)) tmp = 0 if a <= -1.45e-33: tmp = t_1 elif a <= -1.9e-117: tmp = x + y elif a <= -2.4e-122: tmp = x + (y * (z / a)) elif a <= 3.35e-40: tmp = x - ((y * z) / t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / a))) tmp = 0.0 if (a <= -1.45e-33) tmp = t_1; elseif (a <= -1.9e-117) tmp = Float64(x + y); elseif (a <= -2.4e-122) tmp = Float64(x + Float64(y * Float64(z / a))); elseif (a <= 3.35e-40) tmp = Float64(x - Float64(Float64(y * z) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / a)); tmp = 0.0; if (a <= -1.45e-33) tmp = t_1; elseif (a <= -1.9e-117) tmp = x + y; elseif (a <= -2.4e-122) tmp = x + (y * (z / a)); elseif (a <= 3.35e-40) tmp = x - ((y * z) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.45e-33], t$95$1, If[LessEqual[a, -1.9e-117], N[(x + y), $MachinePrecision], If[LessEqual[a, -2.4e-122], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.35e-40], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a}\\
\mathbf{if}\;a \leq -1.45 \cdot 10^{-33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.9 \cdot 10^{-117}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq -2.4 \cdot 10^{-122}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 3.35 \cdot 10^{-40}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1.45000000000000001e-33 or 3.3499999999999999e-40 < a Initial program 97.7%
Taylor expanded in a around inf 83.0%
if -1.45000000000000001e-33 < a < -1.89999999999999986e-117Initial program 99.9%
Taylor expanded in t around inf 63.6%
+-commutative63.6%
Simplified63.6%
if -1.89999999999999986e-117 < a < -2.39999999999999987e-122Initial program 100.0%
Taylor expanded in t around 0 100.0%
if -2.39999999999999987e-122 < a < 3.3499999999999999e-40Initial program 93.2%
Taylor expanded in z around inf 80.8%
Taylor expanded in a around 0 72.6%
+-commutative72.6%
associate-*r/72.6%
mul-1-neg72.6%
distribute-rgt-neg-out72.6%
Simplified72.6%
Taylor expanded in y around 0 72.6%
mul-1-neg72.6%
associate-*r/69.8%
distribute-lft-neg-in69.8%
cancel-sign-sub-inv69.8%
Simplified69.8%
Taylor expanded in y around 0 72.6%
Final simplification77.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.4e-56)
(+ x y)
(if (<= t 4.4e-100)
(+ x (* z (/ y a)))
(if (or (<= t 1.28e-27) (not (<= t 8.5e+160)))
(+ x y)
(+ x (* y (/ z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.4e-56) {
tmp = x + y;
} else if (t <= 4.4e-100) {
tmp = x + (z * (y / a));
} else if ((t <= 1.28e-27) || !(t <= 8.5e+160)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-5.4d-56)) then
tmp = x + y
else if (t <= 4.4d-100) then
tmp = x + (z * (y / a))
else if ((t <= 1.28d-27) .or. (.not. (t <= 8.5d+160))) then
tmp = x + y
else
tmp = x + (y * (z / 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 <= -5.4e-56) {
tmp = x + y;
} else if (t <= 4.4e-100) {
tmp = x + (z * (y / a));
} else if ((t <= 1.28e-27) || !(t <= 8.5e+160)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.4e-56: tmp = x + y elif t <= 4.4e-100: tmp = x + (z * (y / a)) elif (t <= 1.28e-27) or not (t <= 8.5e+160): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.4e-56) tmp = Float64(x + y); elseif (t <= 4.4e-100) tmp = Float64(x + Float64(z * Float64(y / a))); elseif ((t <= 1.28e-27) || !(t <= 8.5e+160)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.4e-56) tmp = x + y; elseif (t <= 4.4e-100) tmp = x + (z * (y / a)); elseif ((t <= 1.28e-27) || ~((t <= 8.5e+160))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.4e-56], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.4e-100], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 1.28e-27], N[Not[LessEqual[t, 8.5e+160]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.4 \cdot 10^{-56}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-100}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 1.28 \cdot 10^{-27} \lor \neg \left(t \leq 8.5 \cdot 10^{+160}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -5.3999999999999999e-56 or 4.39999999999999978e-100 < t < 1.27999999999999993e-27 or 8.49999999999999982e160 < t Initial program 99.9%
Taylor expanded in t around inf 73.0%
+-commutative73.0%
Simplified73.0%
if -5.3999999999999999e-56 < t < 4.39999999999999978e-100Initial program 90.5%
Taylor expanded in t around 0 81.0%
+-commutative81.0%
associate-/l*83.9%
associate-/r/84.6%
Simplified84.6%
if 1.27999999999999993e-27 < t < 8.49999999999999982e160Initial program 99.8%
Taylor expanded in t around 0 64.2%
Final simplification76.3%
(FPCore (x y z t a)
:precision binary64
(if (<= t -9.5e-56)
(+ x y)
(if (<= t 4.4e-100)
(+ x (* z (/ y a)))
(if (or (<= t 1e-27) (not (<= t 7.5e+122)))
(+ x y)
(+ x (/ z (/ a y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.5e-56) {
tmp = x + y;
} else if (t <= 4.4e-100) {
tmp = x + (z * (y / a));
} else if ((t <= 1e-27) || !(t <= 7.5e+122)) {
tmp = x + y;
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-9.5d-56)) then
tmp = x + y
else if (t <= 4.4d-100) then
tmp = x + (z * (y / a))
else if ((t <= 1d-27) .or. (.not. (t <= 7.5d+122))) then
tmp = x + y
else
tmp = x + (z / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.5e-56) {
tmp = x + y;
} else if (t <= 4.4e-100) {
tmp = x + (z * (y / a));
} else if ((t <= 1e-27) || !(t <= 7.5e+122)) {
tmp = x + y;
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -9.5e-56: tmp = x + y elif t <= 4.4e-100: tmp = x + (z * (y / a)) elif (t <= 1e-27) or not (t <= 7.5e+122): tmp = x + y else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -9.5e-56) tmp = Float64(x + y); elseif (t <= 4.4e-100) tmp = Float64(x + Float64(z * Float64(y / a))); elseif ((t <= 1e-27) || !(t <= 7.5e+122)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -9.5e-56) tmp = x + y; elseif (t <= 4.4e-100) tmp = x + (z * (y / a)); elseif ((t <= 1e-27) || ~((t <= 7.5e+122))) tmp = x + y; else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9.5e-56], N[(x + y), $MachinePrecision], If[LessEqual[t, 4.4e-100], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 1e-27], N[Not[LessEqual[t, 7.5e+122]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{-56}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-100}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 10^{-27} \lor \neg \left(t \leq 7.5 \cdot 10^{+122}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -9.4999999999999991e-56 or 4.39999999999999978e-100 < t < 1e-27 or 7.5000000000000002e122 < t Initial program 99.9%
Taylor expanded in t around inf 71.6%
+-commutative71.6%
Simplified71.6%
if -9.4999999999999991e-56 < t < 4.39999999999999978e-100Initial program 90.5%
Taylor expanded in t around 0 81.0%
+-commutative81.0%
associate-/l*83.9%
associate-/r/84.6%
Simplified84.6%
if 1e-27 < t < 7.5000000000000002e122Initial program 99.7%
Taylor expanded in t around 0 61.0%
+-commutative61.0%
associate-/l*64.0%
associate-/r/67.4%
Simplified67.4%
*-commutative67.4%
clear-num67.3%
un-div-inv67.4%
Applied egg-rr67.4%
Final simplification76.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.1e-33)
(+ x (/ z (/ a y)))
(if (<= a -7.8e-115)
(+ x y)
(if (<= a 4.4e-140)
(- x (/ (* y z) t))
(if (<= a 0.0225) (+ x y) (+ x (* y (/ z a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.1e-33) {
tmp = x + (z / (a / y));
} else if (a <= -7.8e-115) {
tmp = x + y;
} else if (a <= 4.4e-140) {
tmp = x - ((y * z) / t);
} else if (a <= 0.0225) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-3.1d-33)) then
tmp = x + (z / (a / y))
else if (a <= (-7.8d-115)) then
tmp = x + y
else if (a <= 4.4d-140) then
tmp = x - ((y * z) / t)
else if (a <= 0.0225d0) then
tmp = x + y
else
tmp = x + (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.1e-33) {
tmp = x + (z / (a / y));
} else if (a <= -7.8e-115) {
tmp = x + y;
} else if (a <= 4.4e-140) {
tmp = x - ((y * z) / t);
} else if (a <= 0.0225) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.1e-33: tmp = x + (z / (a / y)) elif a <= -7.8e-115: tmp = x + y elif a <= 4.4e-140: tmp = x - ((y * z) / t) elif a <= 0.0225: tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.1e-33) tmp = Float64(x + Float64(z / Float64(a / y))); elseif (a <= -7.8e-115) tmp = Float64(x + y); elseif (a <= 4.4e-140) tmp = Float64(x - Float64(Float64(y * z) / t)); elseif (a <= 0.0225) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.1e-33) tmp = x + (z / (a / y)); elseif (a <= -7.8e-115) tmp = x + y; elseif (a <= 4.4e-140) tmp = x - ((y * z) / t); elseif (a <= 0.0225) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.1e-33], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -7.8e-115], N[(x + y), $MachinePrecision], If[LessEqual[a, 4.4e-140], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 0.0225], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{-33}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{elif}\;a \leq -7.8 \cdot 10^{-115}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 4.4 \cdot 10^{-140}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\mathbf{elif}\;a \leq 0.0225:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if a < -3.09999999999999997e-33Initial program 95.6%
Taylor expanded in t around 0 64.7%
+-commutative64.7%
associate-/l*70.1%
associate-/r/71.7%
Simplified71.7%
*-commutative71.7%
clear-num71.7%
un-div-inv71.8%
Applied egg-rr71.8%
if -3.09999999999999997e-33 < a < -7.7999999999999997e-115 or 4.3999999999999998e-140 < a < 0.022499999999999999Initial program 96.3%
Taylor expanded in t around inf 73.7%
+-commutative73.7%
Simplified73.7%
if -7.7999999999999997e-115 < a < 4.3999999999999998e-140Initial program 93.9%
Taylor expanded in z around inf 85.8%
Taylor expanded in a around 0 75.4%
+-commutative75.4%
associate-*r/75.4%
mul-1-neg75.4%
distribute-rgt-neg-out75.4%
Simplified75.4%
Taylor expanded in y around 0 75.4%
mul-1-neg75.4%
associate-*r/70.9%
distribute-lft-neg-in70.9%
cancel-sign-sub-inv70.9%
Simplified70.9%
Taylor expanded in y around 0 75.4%
if 0.022499999999999999 < a Initial program 99.8%
Taylor expanded in t around 0 78.7%
Final simplification74.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.2e+138) (not (<= t 5.2e+192))) (+ x y) (+ x (* (/ y (- a t)) z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.2e+138) || !(t <= 5.2e+192)) {
tmp = x + y;
} else {
tmp = x + ((y / (a - t)) * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3.2d+138)) .or. (.not. (t <= 5.2d+192))) then
tmp = x + y
else
tmp = x + ((y / (a - t)) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.2e+138) || !(t <= 5.2e+192)) {
tmp = x + y;
} else {
tmp = x + ((y / (a - t)) * z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.2e+138) or not (t <= 5.2e+192): tmp = x + y else: tmp = x + ((y / (a - t)) * z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.2e+138) || !(t <= 5.2e+192)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y / Float64(a - t)) * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.2e+138) || ~((t <= 5.2e+192))) tmp = x + y; else tmp = x + ((y / (a - t)) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.2e+138], N[Not[LessEqual[t, 5.2e+192]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+138} \lor \neg \left(t \leq 5.2 \cdot 10^{+192}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a - t} \cdot z\\
\end{array}
\end{array}
if t < -3.2000000000000001e138 or 5.20000000000000006e192 < t Initial program 100.0%
Taylor expanded in t around inf 88.1%
+-commutative88.1%
Simplified88.1%
if -3.2000000000000001e138 < t < 5.20000000000000006e192Initial program 95.3%
Taylor expanded in z around inf 80.1%
associate-/l*82.6%
associate-/r/83.7%
Applied egg-rr83.7%
Final simplification84.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.098) (not (<= z 7.5e-74))) (+ x (* (/ y (- a t)) z)) (- x (* y (/ t (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.098) || !(z <= 7.5e-74)) {
tmp = x + ((y / (a - t)) * z);
} else {
tmp = x - (y * (t / (a - 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 <= (-0.098d0)) .or. (.not. (z <= 7.5d-74))) then
tmp = x + ((y / (a - t)) * z)
else
tmp = x - (y * (t / (a - 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 <= -0.098) || !(z <= 7.5e-74)) {
tmp = x + ((y / (a - t)) * z);
} else {
tmp = x - (y * (t / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.098) or not (z <= 7.5e-74): tmp = x + ((y / (a - t)) * z) else: tmp = x - (y * (t / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.098) || !(z <= 7.5e-74)) tmp = Float64(x + Float64(Float64(y / Float64(a - t)) * z)); else tmp = Float64(x - Float64(y * Float64(t / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -0.098) || ~((z <= 7.5e-74))) tmp = x + ((y / (a - t)) * z); else tmp = x - (y * (t / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.098], N[Not[LessEqual[z, 7.5e-74]], $MachinePrecision]], N[(x + N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.098 \lor \neg \left(z \leq 7.5 \cdot 10^{-74}\right):\\
\;\;\;\;x + \frac{y}{a - t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\end{array}
\end{array}
if z < -0.098000000000000004 or 7.5e-74 < z Initial program 95.2%
Taylor expanded in z around inf 81.5%
associate-/l*87.3%
associate-/r/88.8%
Applied egg-rr88.8%
if -0.098000000000000004 < z < 7.5e-74Initial program 97.4%
Taylor expanded in z around 0 86.2%
mul-1-neg86.2%
unsub-neg86.2%
associate-/l*93.5%
Simplified93.5%
associate-/r/93.7%
Applied egg-rr93.7%
Final simplification91.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.6e-54) (not (<= t 8.5e+160))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.6e-54) || !(t <= 8.5e+160)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3.6d-54)) .or. (.not. (t <= 8.5d+160))) then
tmp = x + y
else
tmp = x + (y * (z / 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 <= -3.6e-54) || !(t <= 8.5e+160)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.6e-54) or not (t <= 8.5e+160): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.6e-54) || !(t <= 8.5e+160)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.6e-54) || ~((t <= 8.5e+160))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.6e-54], N[Not[LessEqual[t, 8.5e+160]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{-54} \lor \neg \left(t \leq 8.5 \cdot 10^{+160}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -3.59999999999999976e-54 or 8.49999999999999982e160 < t Initial program 99.9%
Taylor expanded in t around inf 73.2%
+-commutative73.2%
Simplified73.2%
if -3.59999999999999976e-54 < t < 8.49999999999999982e160Initial program 94.0%
Taylor expanded in t around 0 75.0%
Final simplification74.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3e-94) (not (<= t 9.5e-90))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3e-94) || !(t <= 9.5e-90)) {
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 ((t <= (-3d-94)) .or. (.not. (t <= 9.5d-90))) 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 ((t <= -3e-94) || !(t <= 9.5e-90)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3e-94) or not (t <= 9.5e-90): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3e-94) || !(t <= 9.5e-90)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3e-94) || ~((t <= 9.5e-90))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3e-94], N[Not[LessEqual[t, 9.5e-90]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3 \cdot 10^{-94} \lor \neg \left(t \leq 9.5 \cdot 10^{-90}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -3.0000000000000001e-94 or 9.5000000000000003e-90 < t Initial program 98.7%
Taylor expanded in t around inf 66.6%
+-commutative66.6%
Simplified66.6%
if -3.0000000000000001e-94 < t < 9.5000000000000003e-90Initial program 91.9%
Taylor expanded in x around inf 57.8%
Final simplification63.3%
(FPCore (x y z t a) :precision binary64 (+ x (* (/ y (- a t)) (- z t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y / (a - t)) * (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 / (a - t)) * (z - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y / (a - t)) * (z - t));
}
def code(x, y, z, t, a): return x + ((y / (a - t)) * (z - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y / Float64(a - t)) * Float64(z - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y / (a - t)) * (z - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{a - t} \cdot \left(z - t\right)
\end{array}
Initial program 96.2%
associate-*r/86.3%
Simplified86.3%
associate-/l*96.5%
associate-/r/97.2%
Applied egg-rr97.2%
Final simplification97.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 96.2%
Taylor expanded in x around inf 52.2%
Final simplification52.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} 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 * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
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 * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
herbie shell --seed 2024018
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))