
(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 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 98.8%
+-commutative98.8%
fma-def98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.8e+142)
(+ y x)
(if (<= z -1.3e-38)
(- x (* y (/ t z)))
(if (or (<= z 1.02e-14) (and (not (<= z 8.4e+58)) (<= z 7e+125)))
(+ x (* y (/ t a)))
(+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+142) {
tmp = y + x;
} else if (z <= -1.3e-38) {
tmp = x - (y * (t / z));
} else if ((z <= 1.02e-14) || (!(z <= 8.4e+58) && (z <= 7e+125))) {
tmp = x + (y * (t / a));
} else {
tmp = y + 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 <= (-4.8d+142)) then
tmp = y + x
else if (z <= (-1.3d-38)) then
tmp = x - (y * (t / z))
else if ((z <= 1.02d-14) .or. (.not. (z <= 8.4d+58)) .and. (z <= 7d+125)) then
tmp = x + (y * (t / a))
else
tmp = y + 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 <= -4.8e+142) {
tmp = y + x;
} else if (z <= -1.3e-38) {
tmp = x - (y * (t / z));
} else if ((z <= 1.02e-14) || (!(z <= 8.4e+58) && (z <= 7e+125))) {
tmp = x + (y * (t / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.8e+142: tmp = y + x elif z <= -1.3e-38: tmp = x - (y * (t / z)) elif (z <= 1.02e-14) or (not (z <= 8.4e+58) and (z <= 7e+125)): tmp = x + (y * (t / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e+142) tmp = Float64(y + x); elseif (z <= -1.3e-38) tmp = Float64(x - Float64(y * Float64(t / z))); elseif ((z <= 1.02e-14) || (!(z <= 8.4e+58) && (z <= 7e+125))) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.8e+142) tmp = y + x; elseif (z <= -1.3e-38) tmp = x - (y * (t / z)); elseif ((z <= 1.02e-14) || (~((z <= 8.4e+58)) && (z <= 7e+125))) tmp = x + (y * (t / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e+142], N[(y + x), $MachinePrecision], If[LessEqual[z, -1.3e-38], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.02e-14], And[N[Not[LessEqual[z, 8.4e+58]], $MachinePrecision], LessEqual[z, 7e+125]]], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+142}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-38}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-14} \lor \neg \left(z \leq 8.4 \cdot 10^{+58}\right) \land z \leq 7 \cdot 10^{+125}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -4.7999999999999998e142 or 1.02e-14 < z < 8.40000000000000048e58 or 7.00000000000000023e125 < z Initial program 100.0%
Taylor expanded in z around inf 87.1%
if -4.7999999999999998e142 < z < -1.30000000000000005e-38Initial program 99.8%
Taylor expanded in a around 0 82.8%
+-commutative82.8%
*-commutative82.8%
associate-/l*90.1%
Simplified90.1%
Taylor expanded in z around 0 80.3%
associate-*r/80.3%
neg-mul-180.3%
Simplified80.3%
Taylor expanded in y around 0 77.9%
+-commutative77.9%
metadata-eval77.9%
associate-*r/80.2%
cancel-sign-sub-inv80.2%
*-lft-identity80.2%
Simplified80.2%
if -1.30000000000000005e-38 < z < 1.02e-14 or 8.40000000000000048e58 < z < 7.00000000000000023e125Initial program 97.7%
Taylor expanded in z around 0 77.5%
Final simplification81.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.2e+142)
(+ y x)
(if (<= z -2.7e-32)
(- x (/ y (/ z t)))
(if (or (<= z 1.75e-12) (and (not (<= z 4.5e+57)) (<= z 7e+125)))
(+ x (* y (/ t a)))
(+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+142) {
tmp = y + x;
} else if (z <= -2.7e-32) {
tmp = x - (y / (z / t));
} else if ((z <= 1.75e-12) || (!(z <= 4.5e+57) && (z <= 7e+125))) {
tmp = x + (y * (t / a));
} else {
tmp = y + 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.2d+142)) then
tmp = y + x
else if (z <= (-2.7d-32)) then
tmp = x - (y / (z / t))
else if ((z <= 1.75d-12) .or. (.not. (z <= 4.5d+57)) .and. (z <= 7d+125)) then
tmp = x + (y * (t / a))
else
tmp = y + 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.2e+142) {
tmp = y + x;
} else if (z <= -2.7e-32) {
tmp = x - (y / (z / t));
} else if ((z <= 1.75e-12) || (!(z <= 4.5e+57) && (z <= 7e+125))) {
tmp = x + (y * (t / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.2e+142: tmp = y + x elif z <= -2.7e-32: tmp = x - (y / (z / t)) elif (z <= 1.75e-12) or (not (z <= 4.5e+57) and (z <= 7e+125)): tmp = x + (y * (t / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e+142) tmp = Float64(y + x); elseif (z <= -2.7e-32) tmp = Float64(x - Float64(y / Float64(z / t))); elseif ((z <= 1.75e-12) || (!(z <= 4.5e+57) && (z <= 7e+125))) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.2e+142) tmp = y + x; elseif (z <= -2.7e-32) tmp = x - (y / (z / t)); elseif ((z <= 1.75e-12) || (~((z <= 4.5e+57)) && (z <= 7e+125))) tmp = x + (y * (t / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+142], N[(y + x), $MachinePrecision], If[LessEqual[z, -2.7e-32], N[(x - N[(y / N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.75e-12], And[N[Not[LessEqual[z, 4.5e+57]], $MachinePrecision], LessEqual[z, 7e+125]]], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+142}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-32}:\\
\;\;\;\;x - \frac{y}{\frac{z}{t}}\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-12} \lor \neg \left(z \leq 4.5 \cdot 10^{+57}\right) \land z \leq 7 \cdot 10^{+125}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -5.20000000000000043e142 or 1.75e-12 < z < 4.49999999999999996e57 or 7.00000000000000023e125 < z Initial program 100.0%
Taylor expanded in z around inf 87.1%
if -5.20000000000000043e142 < z < -2.69999999999999981e-32Initial program 99.8%
Taylor expanded in a around 0 82.8%
+-commutative82.8%
*-commutative82.8%
associate-/l*90.1%
Simplified90.1%
Taylor expanded in z around 0 80.3%
associate-*r/80.3%
neg-mul-180.3%
Simplified80.3%
Taylor expanded in y around 0 77.9%
+-commutative77.9%
metadata-eval77.9%
associate-*r/80.2%
cancel-sign-sub-inv80.2%
*-lft-identity80.2%
associate-*r/77.9%
associate-/l*80.3%
Simplified80.3%
if -2.69999999999999981e-32 < z < 1.75e-12 or 4.49999999999999996e57 < z < 7.00000000000000023e125Initial program 97.7%
Taylor expanded in z around 0 77.5%
Final simplification81.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) z)))))
(if (<= z -2.6e-47)
t_1
(if (<= z 5.8e-133)
(+ x (* y (/ t a)))
(if (<= z 1.65e-48)
(+ x (* y (/ z (- z a))))
(if (<= z 6.5128e-45) (+ x (* t (/ y a))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / z));
double tmp;
if (z <= -2.6e-47) {
tmp = t_1;
} else if (z <= 5.8e-133) {
tmp = x + (y * (t / a));
} else if (z <= 1.65e-48) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 6.5128e-45) {
tmp = x + (t * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * ((z - t) / z))
if (z <= (-2.6d-47)) then
tmp = t_1
else if (z <= 5.8d-133) then
tmp = x + (y * (t / a))
else if (z <= 1.65d-48) then
tmp = x + (y * (z / (z - a)))
else if (z <= 6.5128d-45) then
tmp = x + (t * (y / a))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / z));
double tmp;
if (z <= -2.6e-47) {
tmp = t_1;
} else if (z <= 5.8e-133) {
tmp = x + (y * (t / a));
} else if (z <= 1.65e-48) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 6.5128e-45) {
tmp = x + (t * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / z)) tmp = 0 if z <= -2.6e-47: tmp = t_1 elif z <= 5.8e-133: tmp = x + (y * (t / a)) elif z <= 1.65e-48: tmp = x + (y * (z / (z - a))) elif z <= 6.5128e-45: tmp = x + (t * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / z))) tmp = 0.0 if (z <= -2.6e-47) tmp = t_1; elseif (z <= 5.8e-133) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 1.65e-48) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 6.5128e-45) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / z)); tmp = 0.0; if (z <= -2.6e-47) tmp = t_1; elseif (z <= 5.8e-133) tmp = x + (y * (t / a)); elseif (z <= 1.65e-48) tmp = x + (y * (z / (z - a))); elseif (z <= 6.5128e-45) tmp = x + (t * (y / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e-47], t$95$1, If[LessEqual[z, 5.8e-133], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e-48], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5128e-45], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{z}\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-133}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-48}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 6.5128 \cdot 10^{-45}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.6e-47 or 6.5128000000000001e-45 < z Initial program 99.9%
Taylor expanded in a around 0 89.7%
if -2.6e-47 < z < 5.7999999999999997e-133Initial program 97.7%
Taylor expanded in z around 0 82.2%
if 5.7999999999999997e-133 < z < 1.65e-48Initial program 95.5%
Taylor expanded in t around 0 81.6%
if 1.65e-48 < z < 6.5128000000000001e-45Initial program 99.5%
Taylor expanded in z around 0 79.1%
div-inv79.1%
*-commutative79.1%
associate-*l*79.1%
div-inv79.1%
Applied egg-rr79.1%
Final simplification86.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ z (- z t))))))
(if (<= z -3.7e-47)
t_1
(if (<= z 9.2e-135)
(+ x (* y (/ t a)))
(if (<= z 1.55e-47)
(+ x (* y (/ z (- z a))))
(if (<= z 6.5128e-45) (+ x (* t (/ y a))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / (z / (z - t)));
double tmp;
if (z <= -3.7e-47) {
tmp = t_1;
} else if (z <= 9.2e-135) {
tmp = x + (y * (t / a));
} else if (z <= 1.55e-47) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 6.5128e-45) {
tmp = x + (t * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y / (z / (z - t)))
if (z <= (-3.7d-47)) then
tmp = t_1
else if (z <= 9.2d-135) then
tmp = x + (y * (t / a))
else if (z <= 1.55d-47) then
tmp = x + (y * (z / (z - a)))
else if (z <= 6.5128d-45) then
tmp = x + (t * (y / a))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / (z / (z - t)));
double tmp;
if (z <= -3.7e-47) {
tmp = t_1;
} else if (z <= 9.2e-135) {
tmp = x + (y * (t / a));
} else if (z <= 1.55e-47) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 6.5128e-45) {
tmp = x + (t * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / (z / (z - t))) tmp = 0 if z <= -3.7e-47: tmp = t_1 elif z <= 9.2e-135: tmp = x + (y * (t / a)) elif z <= 1.55e-47: tmp = x + (y * (z / (z - a))) elif z <= 6.5128e-45: tmp = x + (t * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(z / Float64(z - t)))) tmp = 0.0 if (z <= -3.7e-47) tmp = t_1; elseif (z <= 9.2e-135) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 1.55e-47) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 6.5128e-45) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / (z / (z - t))); tmp = 0.0; if (z <= -3.7e-47) tmp = t_1; elseif (z <= 9.2e-135) tmp = x + (y * (t / a)); elseif (z <= 1.55e-47) tmp = x + (y * (z / (z - a))); elseif (z <= 6.5128e-45) tmp = x + (t * (y / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.7e-47], t$95$1, If[LessEqual[z, 9.2e-135], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e-47], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5128e-45], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{if}\;z \leq -3.7 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-135}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{-47}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 6.5128 \cdot 10^{-45}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.7e-47 or 6.5128000000000001e-45 < z Initial program 99.9%
Taylor expanded in a around 0 69.2%
+-commutative69.2%
*-commutative69.2%
associate-/l*89.7%
Simplified89.7%
if -3.7e-47 < z < 9.1999999999999996e-135Initial program 97.7%
Taylor expanded in z around 0 82.2%
if 9.1999999999999996e-135 < z < 1.5499999999999999e-47Initial program 95.5%
Taylor expanded in t around 0 81.6%
if 1.5499999999999999e-47 < z < 6.5128000000000001e-45Initial program 99.5%
Taylor expanded in z around 0 79.1%
div-inv79.1%
*-commutative79.1%
associate-*l*79.1%
div-inv79.1%
Applied egg-rr79.1%
Final simplification86.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.1e-47)
(+ y x)
(if (or (<= z 9.2e-14) (and (not (<= z 1.88e+59)) (<= z 7e+125)))
(+ x (* y (/ t a)))
(+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e-47) {
tmp = y + x;
} else if ((z <= 9.2e-14) || (!(z <= 1.88e+59) && (z <= 7e+125))) {
tmp = x + (y * (t / a));
} else {
tmp = y + 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 <= (-3.1d-47)) then
tmp = y + x
else if ((z <= 9.2d-14) .or. (.not. (z <= 1.88d+59)) .and. (z <= 7d+125)) then
tmp = x + (y * (t / a))
else
tmp = y + 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 <= -3.1e-47) {
tmp = y + x;
} else if ((z <= 9.2e-14) || (!(z <= 1.88e+59) && (z <= 7e+125))) {
tmp = x + (y * (t / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.1e-47: tmp = y + x elif (z <= 9.2e-14) or (not (z <= 1.88e+59) and (z <= 7e+125)): tmp = x + (y * (t / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e-47) tmp = Float64(y + x); elseif ((z <= 9.2e-14) || (!(z <= 1.88e+59) && (z <= 7e+125))) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.1e-47) tmp = y + x; elseif ((z <= 9.2e-14) || (~((z <= 1.88e+59)) && (z <= 7e+125))) tmp = x + (y * (t / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e-47], N[(y + x), $MachinePrecision], If[Or[LessEqual[z, 9.2e-14], And[N[Not[LessEqual[z, 1.88e+59]], $MachinePrecision], LessEqual[z, 7e+125]]], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-47}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-14} \lor \neg \left(z \leq 1.88 \cdot 10^{+59}\right) \land z \leq 7 \cdot 10^{+125}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -3.0999999999999998e-47 or 9.19999999999999993e-14 < z < 1.87999999999999989e59 or 7.00000000000000023e125 < z Initial program 99.9%
Taylor expanded in z around inf 80.7%
if -3.0999999999999998e-47 < z < 9.19999999999999993e-14 or 1.87999999999999989e59 < z < 7.00000000000000023e125Initial program 97.6%
Taylor expanded in z around 0 78.0%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e-48) (not (<= z 1.1e-134))) (+ x (* y (/ z (- z a)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e-48) || !(z <= 1.1e-134)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.5d-48)) .or. (.not. (z <= 1.1d-134))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e-48) || !(z <= 1.1e-134)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e-48) or not (z <= 1.1e-134): tmp = x + (y * (z / (z - a))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.5e-48) || !(z <= 1.1e-134)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.5e-48) || ~((z <= 1.1e-134))) tmp = x + (y * (z / (z - a))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.5e-48], N[Not[LessEqual[z, 1.1e-134]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-48} \lor \neg \left(z \leq 1.1 \cdot 10^{-134}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.49999999999999991e-48 or 1.1e-134 < z Initial program 99.4%
Taylor expanded in t around 0 82.1%
if -3.49999999999999991e-48 < z < 1.1e-134Initial program 97.7%
Taylor expanded in z around 0 82.2%
Final simplification82.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.7e-149) (not (<= z 3.8e-15))) (+ x (/ y (/ z (- z t)))) (+ x (* (/ y a) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.7e-149) || !(z <= 3.8e-15)) {
tmp = x + (y / (z / (z - t)));
} 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 ((z <= (-1.7d-149)) .or. (.not. (z <= 3.8d-15))) then
tmp = x + (y / (z / (z - t)))
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 ((z <= -1.7e-149) || !(z <= 3.8e-15)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + ((y / a) * (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.7e-149) or not (z <= 3.8e-15): tmp = x + (y / (z / (z - t))) else: tmp = x + ((y / a) * (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.7e-149) || !(z <= 3.8e-15)) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); else tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.7e-149) || ~((z <= 3.8e-15))) tmp = x + (y / (z / (z - t))); else tmp = x + ((y / a) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.7e-149], N[Not[LessEqual[z, 3.8e-15]], $MachinePrecision]], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{-149} \lor \neg \left(z \leq 3.8 \cdot 10^{-15}\right):\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if z < -1.6999999999999999e-149 or 3.8000000000000002e-15 < z Initial program 99.3%
Taylor expanded in a around 0 69.1%
+-commutative69.1%
*-commutative69.1%
associate-/l*87.1%
Simplified87.1%
if -1.6999999999999999e-149 < z < 3.8000000000000002e-15Initial program 97.9%
clear-num97.8%
associate-/r/97.9%
Applied egg-rr97.9%
Taylor expanded in a around inf 85.8%
+-commutative85.8%
mul-1-neg85.8%
associate-*r/84.3%
*-rgt-identity84.3%
distribute-lft-neg-in84.3%
cancel-sign-sub-inv84.3%
*-commutative84.3%
*-lft-identity84.3%
Simplified84.3%
Final simplification86.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.6e+41) (not (<= t 70000000000.0))) (- x (* y (/ t (- z a)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.6e+41) || !(t <= 70000000000.0)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (y * (z / (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 <= (-2.6d+41)) .or. (.not. (t <= 70000000000.0d0))) then
tmp = x - (y * (t / (z - a)))
else
tmp = x + (y * (z / (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 <= -2.6e+41) || !(t <= 70000000000.0)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.6e+41) or not (t <= 70000000000.0): tmp = x - (y * (t / (z - a))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.6e+41) || !(t <= 70000000000.0)) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.6e+41) || ~((t <= 70000000000.0))) tmp = x - (y * (t / (z - a))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.6e+41], N[Not[LessEqual[t, 70000000000.0]], $MachinePrecision]], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{+41} \lor \neg \left(t \leq 70000000000\right):\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -2.6000000000000001e41 or 7e10 < t Initial program 97.2%
clear-num97.2%
associate-/r/97.2%
Applied egg-rr97.2%
Taylor expanded in t around inf 83.8%
associate-*r/83.8%
mul-1-neg83.8%
distribute-rgt-neg-out83.8%
associate-*l/87.2%
Simplified87.2%
Taylor expanded in x around 0 83.8%
+-commutative83.8%
mul-1-neg83.8%
*-commutative83.8%
associate-/l*87.1%
sub-neg87.1%
associate-/r/88.1%
Simplified88.1%
if -2.6000000000000001e41 < t < 7e10Initial program 99.9%
Taylor expanded in t around 0 95.6%
Final simplification92.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -4.4e+44)
(- x (/ t (/ (- z a) y)))
(if (<= t 4600000000.0)
(+ x (* y (/ z (- z a))))
(- x (* y (/ t (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.4e+44) {
tmp = x - (t / ((z - a) / y));
} else if (t <= 4600000000.0) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - (y * (t / (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 <= (-4.4d+44)) then
tmp = x - (t / ((z - a) / y))
else if (t <= 4600000000.0d0) then
tmp = x + (y * (z / (z - a)))
else
tmp = x - (y * (t / (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 <= -4.4e+44) {
tmp = x - (t / ((z - a) / y));
} else if (t <= 4600000000.0) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.4e+44: tmp = x - (t / ((z - a) / y)) elif t <= 4600000000.0: tmp = x + (y * (z / (z - a))) else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.4e+44) tmp = Float64(x - Float64(t / Float64(Float64(z - a) / y))); elseif (t <= 4600000000.0) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.4e+44) tmp = x - (t / ((z - a) / y)); elseif (t <= 4600000000.0) tmp = x + (y * (z / (z - a))); else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.4e+44], N[(x - N[(t / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4600000000.0], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.4 \cdot 10^{+44}:\\
\;\;\;\;x - \frac{t}{\frac{z - a}{y}}\\
\mathbf{elif}\;t \leq 4600000000:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if t < -4.39999999999999991e44Initial program 95.4%
clear-num95.4%
associate-/r/95.5%
Applied egg-rr95.5%
Taylor expanded in t around inf 83.6%
associate-*r/83.6%
mul-1-neg83.6%
distribute-rgt-neg-out83.6%
associate-*l/86.1%
Simplified86.1%
distribute-rgt-neg-out86.1%
unsub-neg86.1%
clear-num86.0%
associate-*l/86.0%
*-un-lft-identity86.0%
Applied egg-rr86.0%
if -4.39999999999999991e44 < t < 4.6e9Initial program 99.9%
Taylor expanded in t around 0 95.6%
if 4.6e9 < t Initial program 98.3%
clear-num98.3%
associate-/r/98.3%
Applied egg-rr98.3%
Taylor expanded in t around inf 84.0%
associate-*r/84.0%
mul-1-neg84.0%
distribute-rgt-neg-out84.0%
associate-*l/87.8%
Simplified87.8%
Taylor expanded in x around 0 84.0%
+-commutative84.0%
mul-1-neg84.0%
*-commutative84.0%
associate-/l*87.8%
sub-neg87.8%
associate-/r/90.7%
Simplified90.7%
Final simplification92.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.15e+40) (- x (* t (/ y (- z a)))) (if (<= t 6.2e+17) (+ x (* y (/ z (- z a)))) (- x (* y (/ t (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.15e+40) {
tmp = x - (t * (y / (z - a)));
} else if (t <= 6.2e+17) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - (y * (t / (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 <= (-1.15d+40)) then
tmp = x - (t * (y / (z - a)))
else if (t <= 6.2d+17) then
tmp = x + (y * (z / (z - a)))
else
tmp = x - (y * (t / (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 <= -1.15e+40) {
tmp = x - (t * (y / (z - a)));
} else if (t <= 6.2e+17) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.15e+40: tmp = x - (t * (y / (z - a))) elif t <= 6.2e+17: tmp = x + (y * (z / (z - a))) else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.15e+40) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); elseif (t <= 6.2e+17) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.15e+40) tmp = x - (t * (y / (z - a))); elseif (t <= 6.2e+17) tmp = x + (y * (z / (z - a))); else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.15e+40], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e+17], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+40}:\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+17}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if t < -1.14999999999999997e40Initial program 95.4%
clear-num95.4%
associate-/r/95.5%
Applied egg-rr95.5%
Taylor expanded in t around inf 83.6%
associate-*r/83.6%
mul-1-neg83.6%
distribute-rgt-neg-out83.6%
associate-*l/86.1%
Simplified86.1%
if -1.14999999999999997e40 < t < 6.2e17Initial program 99.9%
Taylor expanded in t around 0 95.6%
if 6.2e17 < t Initial program 98.3%
clear-num98.3%
associate-/r/98.3%
Applied egg-rr98.3%
Taylor expanded in t around inf 84.0%
associate-*r/84.0%
mul-1-neg84.0%
distribute-rgt-neg-out84.0%
associate-*l/87.8%
Simplified87.8%
Taylor expanded in x around 0 84.0%
+-commutative84.0%
mul-1-neg84.0%
*-commutative84.0%
associate-/l*87.8%
sub-neg87.8%
associate-/r/90.7%
Simplified90.7%
Final simplification92.8%
(FPCore (x y z t a) :precision binary64 (- x (* y (/ (- t z) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (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 * ((t - z) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (z - a)));
}
def code(x, y, z, t, a): return x - (y * ((t - z) / (z - a)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(t - z) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((t - z) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{t - z}{z - a}
\end{array}
Initial program 98.8%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.5e+175) x (if (<= a 1.65e+116) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.5e+175) {
tmp = x;
} else if (a <= 1.65e+116) {
tmp = y + x;
} 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 (a <= (-4.5d+175)) then
tmp = x
else if (a <= 1.65d+116) then
tmp = y + x
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 (a <= -4.5e+175) {
tmp = x;
} else if (a <= 1.65e+116) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.5e+175: tmp = x elif a <= 1.65e+116: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.5e+175) tmp = x; elseif (a <= 1.65e+116) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.5e+175) tmp = x; elseif (a <= 1.65e+116) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.5e+175], x, If[LessEqual[a, 1.65e+116], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{+175}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{+116}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.49999999999999989e175 or 1.6499999999999999e116 < a Initial program 99.9%
Taylor expanded in x around inf 74.4%
if -4.49999999999999989e175 < a < 1.6499999999999999e116Initial program 98.5%
Taylor expanded in z around inf 64.1%
Final simplification66.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 98.8%
Taylor expanded in x around inf 48.8%
Final simplification48.8%
(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 2023240
(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)))))