
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- 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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(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(Float64(y / 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[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{z - a} \cdot \left(z - t\right)
\end{array}
Initial program 83.1%
associate-*l/97.1%
Simplified97.1%
Final simplification97.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* t (/ y a)))))
(if (<= z -6e+14)
(+ x y)
(if (<= z 1.8e-65)
t_1
(if (<= z 4800.0)
(* y (- 1.0 (/ t z)))
(if (<= z 9.8e+123) t_1 (+ x y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t * (y / a));
double tmp;
if (z <= -6e+14) {
tmp = x + y;
} else if (z <= 1.8e-65) {
tmp = t_1;
} else if (z <= 4800.0) {
tmp = y * (1.0 - (t / z));
} else if (z <= 9.8e+123) {
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) :: tmp
t_1 = x + (t * (y / a))
if (z <= (-6d+14)) then
tmp = x + y
else if (z <= 1.8d-65) then
tmp = t_1
else if (z <= 4800.0d0) then
tmp = y * (1.0d0 - (t / z))
else if (z <= 9.8d+123) 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 + (t * (y / a));
double tmp;
if (z <= -6e+14) {
tmp = x + y;
} else if (z <= 1.8e-65) {
tmp = t_1;
} else if (z <= 4800.0) {
tmp = y * (1.0 - (t / z));
} else if (z <= 9.8e+123) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t * (y / a)) tmp = 0 if z <= -6e+14: tmp = x + y elif z <= 1.8e-65: tmp = t_1 elif z <= 4800.0: tmp = y * (1.0 - (t / z)) elif z <= 9.8e+123: tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t * Float64(y / a))) tmp = 0.0 if (z <= -6e+14) tmp = Float64(x + y); elseif (z <= 1.8e-65) tmp = t_1; elseif (z <= 4800.0) tmp = Float64(y * Float64(1.0 - Float64(t / z))); elseif (z <= 9.8e+123) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t * (y / a)); tmp = 0.0; if (z <= -6e+14) tmp = x + y; elseif (z <= 1.8e-65) tmp = t_1; elseif (z <= 4800.0) tmp = y * (1.0 - (t / z)); elseif (z <= 9.8e+123) 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[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+14], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.8e-65], t$95$1, If[LessEqual[z, 4800.0], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.8e+123], t$95$1, N[(x + y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot \frac{y}{a}\\
\mathbf{if}\;z \leq -6 \cdot 10^{+14}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4800:\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+123}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -6e14 or 9.79999999999999952e123 < z Initial program 67.3%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around inf 75.9%
if -6e14 < z < 1.7999999999999999e-65 or 4800 < z < 9.79999999999999952e123Initial program 92.3%
associate-*l/96.7%
Simplified96.7%
Taylor expanded in z around 0 78.2%
associate-/l*83.2%
associate-/r/82.6%
Applied egg-rr82.6%
if 1.7999999999999999e-65 < z < 4800Initial program 99.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 90.2%
Taylor expanded in y around inf 86.5%
Final simplification80.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.4e+14)
(+ x y)
(if (<= z 1.8e-65)
(+ x (/ t (/ a y)))
(if (<= z 4200.0)
(* y (- 1.0 (/ t z)))
(if (<= z 9.8e+123) (+ x (* t (/ y a))) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.4e+14) {
tmp = x + y;
} else if (z <= 1.8e-65) {
tmp = x + (t / (a / y));
} else if (z <= 4200.0) {
tmp = y * (1.0 - (t / z));
} else if (z <= 9.8e+123) {
tmp = x + (t * (y / 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.4d+14)) then
tmp = x + y
else if (z <= 1.8d-65) then
tmp = x + (t / (a / y))
else if (z <= 4200.0d0) then
tmp = y * (1.0d0 - (t / z))
else if (z <= 9.8d+123) then
tmp = x + (t * (y / 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.4e+14) {
tmp = x + y;
} else if (z <= 1.8e-65) {
tmp = x + (t / (a / y));
} else if (z <= 4200.0) {
tmp = y * (1.0 - (t / z));
} else if (z <= 9.8e+123) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.4e+14: tmp = x + y elif z <= 1.8e-65: tmp = x + (t / (a / y)) elif z <= 4200.0: tmp = y * (1.0 - (t / z)) elif z <= 9.8e+123: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.4e+14) tmp = Float64(x + y); elseif (z <= 1.8e-65) tmp = Float64(x + Float64(t / Float64(a / y))); elseif (z <= 4200.0) tmp = Float64(y * Float64(1.0 - Float64(t / z))); elseif (z <= 9.8e+123) tmp = Float64(x + Float64(t * Float64(y / 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.4e+14) tmp = x + y; elseif (z <= 1.8e-65) tmp = x + (t / (a / y)); elseif (z <= 4200.0) tmp = y * (1.0 - (t / z)); elseif (z <= 9.8e+123) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.4e+14], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.8e-65], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4200.0], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.8e+123], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+14}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-65}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;z \leq 4200:\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+123}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -3.4e14 or 9.79999999999999952e123 < z Initial program 67.3%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around inf 75.9%
if -3.4e14 < z < 1.7999999999999999e-65Initial program 93.1%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in z around 0 80.7%
associate-/l*85.2%
associate-/r/84.3%
Applied egg-rr84.3%
*-commutative84.3%
clear-num84.3%
div-inv84.3%
Applied egg-rr84.3%
if 1.7999999999999999e-65 < z < 4200Initial program 99.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 90.2%
Taylor expanded in y around inf 86.5%
if 4200 < z < 9.79999999999999952e123Initial program 87.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around 0 65.0%
associate-/l*73.1%
associate-/r/73.2%
Applied egg-rr73.2%
Final simplification80.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.8e+14)
(+ x y)
(if (<= z 1.8e-65)
(+ x (/ y (/ a t)))
(if (<= z 4200.0)
(* y (- 1.0 (/ t z)))
(if (<= z 9.8e+123) (+ x (* t (/ y a))) (+ x y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.8e+14) {
tmp = x + y;
} else if (z <= 1.8e-65) {
tmp = x + (y / (a / t));
} else if (z <= 4200.0) {
tmp = y * (1.0 - (t / z));
} else if (z <= 9.8e+123) {
tmp = x + (t * (y / 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 <= (-2.8d+14)) then
tmp = x + y
else if (z <= 1.8d-65) then
tmp = x + (y / (a / t))
else if (z <= 4200.0d0) then
tmp = y * (1.0d0 - (t / z))
else if (z <= 9.8d+123) then
tmp = x + (t * (y / 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 <= -2.8e+14) {
tmp = x + y;
} else if (z <= 1.8e-65) {
tmp = x + (y / (a / t));
} else if (z <= 4200.0) {
tmp = y * (1.0 - (t / z));
} else if (z <= 9.8e+123) {
tmp = x + (t * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.8e+14: tmp = x + y elif z <= 1.8e-65: tmp = x + (y / (a / t)) elif z <= 4200.0: tmp = y * (1.0 - (t / z)) elif z <= 9.8e+123: tmp = x + (t * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.8e+14) tmp = Float64(x + y); elseif (z <= 1.8e-65) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 4200.0) tmp = Float64(y * Float64(1.0 - Float64(t / z))); elseif (z <= 9.8e+123) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.8e+14) tmp = x + y; elseif (z <= 1.8e-65) tmp = x + (y / (a / t)); elseif (z <= 4200.0) tmp = y * (1.0 - (t / z)); elseif (z <= 9.8e+123) tmp = x + (t * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.8e+14], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.8e-65], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4200.0], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.8e+123], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+14}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-65}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 4200:\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+123}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.8e14 or 9.79999999999999952e123 < z Initial program 67.3%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around inf 75.9%
if -2.8e14 < z < 1.7999999999999999e-65Initial program 93.1%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in z around 0 80.7%
associate-/l*85.2%
Simplified85.2%
if 1.7999999999999999e-65 < z < 4200Initial program 99.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 90.2%
Taylor expanded in y around inf 86.5%
if 4200 < z < 9.79999999999999952e123Initial program 87.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around 0 65.0%
associate-/l*73.1%
associate-/r/73.2%
Applied egg-rr73.2%
Final simplification80.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- z t) (/ y z)))))
(if (<= z -5.8e+110)
t_1
(if (<= z -1.55e-15)
(+ x (/ y (/ (- z a) z)))
(if (<= z 6.2e-68) (+ x (/ y (/ a t))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((z - t) * (y / z));
double tmp;
if (z <= -5.8e+110) {
tmp = t_1;
} else if (z <= -1.55e-15) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 6.2e-68) {
tmp = x + (y / (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 + ((z - t) * (y / z))
if (z <= (-5.8d+110)) then
tmp = t_1
else if (z <= (-1.55d-15)) then
tmp = x + (y / ((z - a) / z))
else if (z <= 6.2d-68) then
tmp = x + (y / (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 + ((z - t) * (y / z));
double tmp;
if (z <= -5.8e+110) {
tmp = t_1;
} else if (z <= -1.55e-15) {
tmp = x + (y / ((z - a) / z));
} else if (z <= 6.2e-68) {
tmp = x + (y / (a / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((z - t) * (y / z)) tmp = 0 if z <= -5.8e+110: tmp = t_1 elif z <= -1.55e-15: tmp = x + (y / ((z - a) / z)) elif z <= 6.2e-68: tmp = x + (y / (a / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(z - t) * Float64(y / z))) tmp = 0.0 if (z <= -5.8e+110) tmp = t_1; elseif (z <= -1.55e-15) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); elseif (z <= 6.2e-68) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((z - t) * (y / z)); tmp = 0.0; if (z <= -5.8e+110) tmp = t_1; elseif (z <= -1.55e-15) tmp = x + (y / ((z - a) / z)); elseif (z <= 6.2e-68) tmp = x + (y / (a / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e+110], t$95$1, If[LessEqual[z, -1.55e-15], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.2e-68], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+110}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-15}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-68}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.7999999999999999e110 or 6.1999999999999999e-68 < z Initial program 74.0%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in z around inf 88.5%
if -5.7999999999999999e110 < z < -1.5499999999999999e-15Initial program 79.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in t around 0 72.9%
associate-/l*87.6%
Simplified87.6%
if -1.5499999999999999e-15 < z < 6.1999999999999999e-68Initial program 92.7%
associate-*l/95.9%
Simplified95.9%
Taylor expanded in z around 0 81.2%
associate-/l*85.9%
Simplified85.9%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -26000000000.0) (+ x y) (if (<= z 8e-66) x (if (<= z 3.6e+29) (* y (- 1.0 (/ t z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -26000000000.0) {
tmp = x + y;
} else if (z <= 8e-66) {
tmp = x;
} else if (z <= 3.6e+29) {
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 (z <= (-26000000000.0d0)) then
tmp = x + y
else if (z <= 8d-66) then
tmp = x
else if (z <= 3.6d+29) 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 (z <= -26000000000.0) {
tmp = x + y;
} else if (z <= 8e-66) {
tmp = x;
} else if (z <= 3.6e+29) {
tmp = y * (1.0 - (t / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -26000000000.0: tmp = x + y elif z <= 8e-66: tmp = x elif z <= 3.6e+29: tmp = y * (1.0 - (t / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -26000000000.0) tmp = Float64(x + y); elseif (z <= 8e-66) tmp = x; elseif (z <= 3.6e+29) 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 (z <= -26000000000.0) tmp = x + y; elseif (z <= 8e-66) tmp = x; elseif (z <= 3.6e+29) tmp = y * (1.0 - (t / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -26000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 8e-66], x, If[LessEqual[z, 3.6e+29], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -26000000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-66}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+29}:\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.6e10 or 3.59999999999999976e29 < z Initial program 70.5%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in z around inf 72.6%
if -2.6e10 < z < 7.9999999999999998e-66Initial program 93.1%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in z around 0 80.7%
Taylor expanded in x around inf 54.2%
if 7.9999999999999998e-66 < z < 3.59999999999999976e29Initial program 94.7%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 77.7%
Taylor expanded in y around inf 70.2%
Final simplification63.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.45e+14)
(+ x y)
(if (<= z 2.1e-86)
(+ x (/ y (/ a t)))
(if (<= z 3e+213) (- x (* t (/ y z))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.45e+14) {
tmp = x + y;
} else if (z <= 2.1e-86) {
tmp = x + (y / (a / t));
} else if (z <= 3e+213) {
tmp = x - (t * (y / 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 (z <= (-1.45d+14)) then
tmp = x + y
else if (z <= 2.1d-86) then
tmp = x + (y / (a / t))
else if (z <= 3d+213) then
tmp = x - (t * (y / 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 (z <= -1.45e+14) {
tmp = x + y;
} else if (z <= 2.1e-86) {
tmp = x + (y / (a / t));
} else if (z <= 3e+213) {
tmp = x - (t * (y / z));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.45e+14: tmp = x + y elif z <= 2.1e-86: tmp = x + (y / (a / t)) elif z <= 3e+213: tmp = x - (t * (y / z)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.45e+14) tmp = Float64(x + y); elseif (z <= 2.1e-86) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 3e+213) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.45e+14) tmp = x + y; elseif (z <= 2.1e-86) tmp = x + (y / (a / t)); elseif (z <= 3e+213) tmp = x - (t * (y / z)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.45e+14], N[(x + y), $MachinePrecision], If[LessEqual[z, 2.1e-86], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+213], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+14}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-86}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+213}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.45e14 or 3.0000000000000001e213 < z Initial program 65.4%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in z around inf 77.2%
if -1.45e14 < z < 2.1e-86Initial program 92.8%
associate-*l/96.0%
Simplified96.0%
Taylor expanded in z around 0 80.8%
associate-/l*85.4%
Simplified85.4%
if 2.1e-86 < z < 3.0000000000000001e213Initial program 90.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in t around inf 82.9%
associate-*r/82.9%
mul-1-neg82.9%
distribute-rgt-neg-out82.9%
associate-/l*88.4%
Simplified88.4%
Taylor expanded in x around 0 82.9%
+-commutative82.9%
mul-1-neg82.9%
associate-/l*88.4%
sub-neg88.4%
associate-/r/88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in z around inf 78.5%
associate-*l/80.3%
*-commutative80.3%
Simplified80.3%
Final simplification81.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -52000000000000.0)
(+ x y)
(if (<= z 1.7e-86)
(+ x (/ y (/ a t)))
(if (<= z 3e+213) (- x (/ y (/ z t))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -52000000000000.0) {
tmp = x + y;
} else if (z <= 1.7e-86) {
tmp = x + (y / (a / t));
} else if (z <= 3e+213) {
tmp = x - (y / (z / t));
} 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 <= (-52000000000000.0d0)) then
tmp = x + y
else if (z <= 1.7d-86) then
tmp = x + (y / (a / t))
else if (z <= 3d+213) then
tmp = x - (y / (z / t))
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 <= -52000000000000.0) {
tmp = x + y;
} else if (z <= 1.7e-86) {
tmp = x + (y / (a / t));
} else if (z <= 3e+213) {
tmp = x - (y / (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -52000000000000.0: tmp = x + y elif z <= 1.7e-86: tmp = x + (y / (a / t)) elif z <= 3e+213: tmp = x - (y / (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -52000000000000.0) tmp = Float64(x + y); elseif (z <= 1.7e-86) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 3e+213) tmp = Float64(x - Float64(y / Float64(z / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -52000000000000.0) tmp = x + y; elseif (z <= 1.7e-86) tmp = x + (y / (a / t)); elseif (z <= 3e+213) tmp = x - (y / (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -52000000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.7e-86], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+213], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -52000000000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-86}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+213}:\\
\;\;\;\;x - \frac{y}{\frac{z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.2e13 or 3.0000000000000001e213 < z Initial program 65.4%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in z around inf 77.2%
if -5.2e13 < z < 1.7e-86Initial program 92.8%
associate-*l/96.0%
Simplified96.0%
Taylor expanded in z around 0 80.8%
associate-/l*85.4%
Simplified85.4%
if 1.7e-86 < z < 3.0000000000000001e213Initial program 90.8%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in t around inf 82.9%
associate-*r/82.9%
mul-1-neg82.9%
distribute-rgt-neg-out82.9%
associate-/l*88.4%
Simplified88.4%
Taylor expanded in z around inf 78.5%
+-commutative78.5%
mul-1-neg78.5%
associate-*r/80.3%
sub-neg80.3%
Simplified80.3%
clear-num80.1%
un-div-inv80.3%
Applied egg-rr80.3%
Final simplification81.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -115000000000.0) (not (<= z 2.8e-67))) (+ x (* (- z t) (/ y z))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -115000000000.0) || !(z <= 2.8e-67)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y / (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 <= (-115000000000.0d0)) .or. (.not. (z <= 2.8d-67))) then
tmp = x + ((z - t) * (y / z))
else
tmp = x + (y / (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 <= -115000000000.0) || !(z <= 2.8e-67)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -115000000000.0) or not (z <= 2.8e-67): tmp = x + ((z - t) * (y / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -115000000000.0) || !(z <= 2.8e-67)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -115000000000.0) || ~((z <= 2.8e-67))) tmp = x + ((z - t) * (y / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -115000000000.0], N[Not[LessEqual[z, 2.8e-67]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -115000000000 \lor \neg \left(z \leq 2.8 \cdot 10^{-67}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.15e11 or 2.8000000000000001e-67 < z Initial program 74.2%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in z around inf 84.0%
if -1.15e11 < z < 2.8000000000000001e-67Initial program 93.1%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in z around 0 80.6%
associate-/l*85.0%
Simplified85.0%
Final simplification84.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.1e+62) (not (<= t 2.55e-36))) (- x (* (/ y (- z a)) t)) (+ x (/ y (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.1e+62) || !(t <= 2.55e-36)) {
tmp = x - ((y / (z - a)) * t);
} else {
tmp = x + (y / ((z - a) / 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 <= (-4.1d+62)) .or. (.not. (t <= 2.55d-36))) then
tmp = x - ((y / (z - a)) * t)
else
tmp = x + (y / ((z - a) / 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 <= -4.1e+62) || !(t <= 2.55e-36)) {
tmp = x - ((y / (z - a)) * t);
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.1e+62) or not (t <= 2.55e-36): tmp = x - ((y / (z - a)) * t) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.1e+62) || !(t <= 2.55e-36)) tmp = Float64(x - Float64(Float64(y / Float64(z - a)) * t)); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.1e+62) || ~((t <= 2.55e-36))) tmp = x - ((y / (z - a)) * t); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.1e+62], N[Not[LessEqual[t, 2.55e-36]], $MachinePrecision]], N[(x - N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{+62} \lor \neg \left(t \leq 2.55 \cdot 10^{-36}\right):\\
\;\;\;\;x - \frac{y}{z - a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if t < -4.09999999999999984e62 or 2.54999999999999987e-36 < t Initial program 81.5%
associate-*l/98.4%
Simplified98.4%
Taylor expanded in t around inf 78.1%
associate-*r/78.1%
mul-1-neg78.1%
distribute-rgt-neg-out78.1%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in x around 0 78.1%
+-commutative78.1%
mul-1-neg78.1%
associate-/l*89.4%
sub-neg89.4%
associate-/r/91.6%
*-commutative91.6%
Simplified91.6%
if -4.09999999999999984e62 < t < 2.54999999999999987e-36Initial program 84.8%
associate-*l/95.6%
Simplified95.6%
Taylor expanded in t around 0 77.0%
associate-/l*91.5%
Simplified91.5%
Final simplification91.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -1e+60) (- x (/ t (/ (- z a) y))) (if (<= t 3.1e-44) (+ x (/ y (/ (- z a) z))) (- x (* (/ y (- z a)) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1e+60) {
tmp = x - (t / ((z - a) / y));
} else if (t <= 3.1e-44) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x - ((y / (z - 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 (t <= (-1d+60)) then
tmp = x - (t / ((z - a) / y))
else if (t <= 3.1d-44) then
tmp = x + (y / ((z - a) / z))
else
tmp = x - ((y / (z - 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 (t <= -1e+60) {
tmp = x - (t / ((z - a) / y));
} else if (t <= 3.1e-44) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x - ((y / (z - a)) * t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1e+60: tmp = x - (t / ((z - a) / y)) elif t <= 3.1e-44: tmp = x + (y / ((z - a) / z)) else: tmp = x - ((y / (z - a)) * t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1e+60) tmp = Float64(x - Float64(t / Float64(Float64(z - a) / y))); elseif (t <= 3.1e-44) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); else tmp = Float64(x - Float64(Float64(y / Float64(z - a)) * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1e+60) tmp = x - (t / ((z - a) / y)); elseif (t <= 3.1e-44) tmp = x + (y / ((z - a) / z)); else tmp = x - ((y / (z - a)) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1e+60], N[(x - N[(t / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.1e-44], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+60}:\\
\;\;\;\;x - \frac{t}{\frac{z - a}{y}}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-44}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z - a} \cdot t\\
\end{array}
\end{array}
if t < -9.9999999999999995e59Initial program 77.7%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in t around inf 69.9%
associate-*r/69.9%
mul-1-neg69.9%
distribute-rgt-neg-out69.9%
associate-/l*86.9%
Simplified86.9%
Taylor expanded in x around 0 69.9%
+-commutative69.9%
mul-1-neg69.9%
associate-/l*86.9%
sub-neg86.9%
associate-/r/88.7%
*-commutative88.7%
Simplified88.7%
clear-num88.7%
un-div-inv88.8%
Applied egg-rr88.8%
if -9.9999999999999995e59 < t < 3.09999999999999984e-44Initial program 84.8%
associate-*l/95.6%
Simplified95.6%
Taylor expanded in t around 0 77.0%
associate-/l*91.5%
Simplified91.5%
if 3.09999999999999984e-44 < t Initial program 84.3%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in t around inf 83.9%
associate-*r/83.9%
mul-1-neg83.9%
distribute-rgt-neg-out83.9%
associate-/l*91.1%
Simplified91.1%
Taylor expanded in x around 0 83.9%
+-commutative83.9%
mul-1-neg83.9%
associate-/l*91.1%
sub-neg91.1%
associate-/r/93.6%
*-commutative93.6%
Simplified93.6%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -112000000000.0) (+ x y) (if (<= z 1.75e-65) x (if (<= z 1.28e+26) (* y (/ (- t) z)) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -112000000000.0) {
tmp = x + y;
} else if (z <= 1.75e-65) {
tmp = x;
} else if (z <= 1.28e+26) {
tmp = y * (-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 (z <= (-112000000000.0d0)) then
tmp = x + y
else if (z <= 1.75d-65) then
tmp = x
else if (z <= 1.28d+26) then
tmp = y * (-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 (z <= -112000000000.0) {
tmp = x + y;
} else if (z <= 1.75e-65) {
tmp = x;
} else if (z <= 1.28e+26) {
tmp = y * (-t / z);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -112000000000.0: tmp = x + y elif z <= 1.75e-65: tmp = x elif z <= 1.28e+26: tmp = y * (-t / z) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -112000000000.0) tmp = Float64(x + y); elseif (z <= 1.75e-65) tmp = x; elseif (z <= 1.28e+26) tmp = Float64(y * Float64(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 (z <= -112000000000.0) tmp = x + y; elseif (z <= 1.75e-65) tmp = x; elseif (z <= 1.28e+26) tmp = y * (-t / z); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -112000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.75e-65], x, If[LessEqual[z, 1.28e+26], N[(y * N[((-t) / z), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -112000000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-65}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.28 \cdot 10^{+26}:\\
\;\;\;\;y \cdot \frac{-t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.12e11 or 1.28e26 < z Initial program 70.5%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in z around inf 72.6%
if -1.12e11 < z < 1.75000000000000002e-65Initial program 93.1%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in z around 0 80.7%
Taylor expanded in x around inf 54.2%
if 1.75000000000000002e-65 < z < 1.28e26Initial program 94.7%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in t around inf 84.7%
associate-*r/84.7%
mul-1-neg84.7%
distribute-rgt-neg-out84.7%
associate-/l*89.7%
Simplified89.7%
Taylor expanded in z around inf 77.8%
+-commutative77.8%
mul-1-neg77.8%
associate-*r/77.8%
sub-neg77.8%
Simplified77.8%
Taylor expanded in x around 0 67.6%
associate-*r/67.6%
neg-mul-167.6%
distribute-rgt-neg-in67.6%
associate-*r/67.7%
Simplified67.7%
Final simplification63.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -28000000000000.0) (+ x y) (if (<= z 1.75e+23) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -28000000000000.0) {
tmp = x + y;
} else if (z <= 1.75e+23) {
tmp = x;
} 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 <= (-28000000000000.0d0)) then
tmp = x + y
else if (z <= 1.75d+23) then
tmp = x
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 <= -28000000000000.0) {
tmp = x + y;
} else if (z <= 1.75e+23) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -28000000000000.0: tmp = x + y elif z <= 1.75e+23: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -28000000000000.0) tmp = Float64(x + y); elseif (z <= 1.75e+23) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -28000000000000.0) tmp = x + y; elseif (z <= 1.75e+23) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -28000000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.75e+23], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -28000000000000:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.8e13 or 1.7500000000000001e23 < z Initial program 71.3%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in z around inf 71.7%
if -2.8e13 < z < 1.7500000000000001e23Initial program 93.2%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in z around 0 74.6%
Taylor expanded in x around inf 49.0%
Final simplification59.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -6e+132) y x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+132) {
tmp = 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 <= (-6d+132)) then
tmp = 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 <= -6e+132) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e+132: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e+132) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6e+132) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+132], y, x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+132}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.9999999999999996e132Initial program 60.5%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in a around 0 60.5%
Taylor expanded in y around inf 69.6%
Taylor expanded in t around 0 54.9%
if -5.9999999999999996e132 < z Initial program 87.0%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in z around 0 64.3%
Taylor expanded in x around inf 48.6%
Final simplification49.5%
(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 83.1%
associate-*l/97.1%
Simplified97.1%
Taylor expanded in z around 0 59.8%
Taylor expanded in x around inf 45.6%
Final simplification45.6%
(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 2023268
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))