
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
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 - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
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 - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* t (/ (- y z) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + (t * ((y - z) / (a - z)));
}
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 + (t * ((y - z) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t * ((y - z) / (a - z)));
}
def code(x, y, z, t, a): return x + (t * ((y - z) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(t * Float64(Float64(y - z) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (t * ((y - z) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + t \cdot \frac{y - z}{a - z}
\end{array}
Initial program 87.0%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in y around 0 86.5%
associate-*r/86.5%
mul-1-neg86.5%
distribute-rgt-neg-out86.5%
associate-*l/88.7%
associate-*l/95.3%
distribute-lft-in97.3%
+-commutative97.3%
sub-neg97.3%
associate-*l/87.0%
associate-*r/98.8%
Simplified98.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6800000000000.0)
(+ x t)
(if (<= z -1.05e-89)
(- x (* t (/ y z)))
(if (<= z 2.2e+50) (+ x (* t (/ y a))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6800000000000.0) {
tmp = x + t;
} else if (z <= -1.05e-89) {
tmp = x - (t * (y / z));
} else if (z <= 2.2e+50) {
tmp = x + (t * (y / a));
} else {
tmp = x + 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 <= (-6800000000000.0d0)) then
tmp = x + t
else if (z <= (-1.05d-89)) then
tmp = x - (t * (y / z))
else if (z <= 2.2d+50) then
tmp = x + (t * (y / a))
else
tmp = x + 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 <= -6800000000000.0) {
tmp = x + t;
} else if (z <= -1.05e-89) {
tmp = x - (t * (y / z));
} else if (z <= 2.2e+50) {
tmp = x + (t * (y / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6800000000000.0: tmp = x + t elif z <= -1.05e-89: tmp = x - (t * (y / z)) elif z <= 2.2e+50: tmp = x + (t * (y / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6800000000000.0) tmp = Float64(x + t); elseif (z <= -1.05e-89) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 2.2e+50) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6800000000000.0) tmp = x + t; elseif (z <= -1.05e-89) tmp = x - (t * (y / z)); elseif (z <= 2.2e+50) tmp = x + (t * (y / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6800000000000.0], N[(x + t), $MachinePrecision], If[LessEqual[z, -1.05e-89], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+50], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6800000000000:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-89}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+50}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -6.8e12 or 2.20000000000000017e50 < z Initial program 77.0%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in z around inf 77.8%
if -6.8e12 < z < -1.05e-89Initial program 99.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 90.7%
mul-1-neg90.7%
unsub-neg90.7%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in y around inf 95.1%
associate-/l*95.1%
Simplified95.1%
if -1.05e-89 < z < 2.20000000000000017e50Initial program 93.9%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in z around 0 81.2%
associate-/l*86.0%
Simplified86.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -15600000000000.0) (not (<= z 1.9e+131))) (+ x (* t (/ z (- z a)))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -15600000000000.0) || !(z <= 1.9e+131)) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + (y * (t / (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 ((z <= (-15600000000000.0d0)) .or. (.not. (z <= 1.9d+131))) then
tmp = x + (t * (z / (z - a)))
else
tmp = x + (y * (t / (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 ((z <= -15600000000000.0) || !(z <= 1.9e+131)) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -15600000000000.0) or not (z <= 1.9e+131): tmp = x + (t * (z / (z - a))) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -15600000000000.0) || !(z <= 1.9e+131)) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -15600000000000.0) || ~((z <= 1.9e+131))) tmp = x + (t * (z / (z - a))); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -15600000000000.0], N[Not[LessEqual[z, 1.9e+131]], $MachinePrecision]], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -15600000000000 \lor \neg \left(z \leq 1.9 \cdot 10^{+131}\right):\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -1.56e13 or 1.9000000000000002e131 < z Initial program 73.0%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in y around 0 68.3%
associate-*r/68.3%
mul-1-neg68.3%
distribute-rgt-neg-out68.3%
associate-*l/86.9%
*-commutative86.9%
distribute-lft-neg-out86.9%
distribute-rgt-neg-in86.9%
distribute-frac-neg286.9%
neg-sub086.9%
sub-neg86.9%
+-commutative86.9%
associate--r+86.9%
neg-sub086.9%
remove-double-neg86.9%
Simplified86.9%
clear-num86.8%
un-div-inv86.9%
Applied egg-rr86.9%
associate-/r/91.2%
Simplified91.2%
if -1.56e13 < z < 1.9000000000000002e131Initial program 94.8%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in y around inf 92.6%
Final simplification92.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.2e+139) (not (<= z 4.8e+138))) (+ x t) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.2e+139) || !(z <= 4.8e+138)) {
tmp = x + t;
} else {
tmp = x + (y * (t / (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 ((z <= (-4.2d+139)) .or. (.not. (z <= 4.8d+138))) then
tmp = x + t
else
tmp = x + (y * (t / (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 ((z <= -4.2e+139) || !(z <= 4.8e+138)) {
tmp = x + t;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.2e+139) or not (z <= 4.8e+138): tmp = x + t else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.2e+139) || !(z <= 4.8e+138)) tmp = Float64(x + t); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.2e+139) || ~((z <= 4.8e+138))) tmp = x + t; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.2e+139], N[Not[LessEqual[z, 4.8e+138]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+139} \lor \neg \left(z \leq 4.8 \cdot 10^{+138}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -4.1999999999999997e139 or 4.8000000000000002e138 < z Initial program 65.0%
associate-/l*92.2%
Simplified92.2%
Taylor expanded in z around inf 89.7%
if -4.1999999999999997e139 < z < 4.8000000000000002e138Initial program 94.1%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in y around inf 89.6%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.5e+137) (not (<= z 4.45e+142))) (+ x t) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.5e+137) || !(z <= 4.45e+142)) {
tmp = x + t;
} else {
tmp = x + (t * (y / (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 ((z <= (-6.5d+137)) .or. (.not. (z <= 4.45d+142))) then
tmp = x + t
else
tmp = x + (t * (y / (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 ((z <= -6.5e+137) || !(z <= 4.45e+142)) {
tmp = x + t;
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.5e+137) or not (z <= 4.45e+142): tmp = x + t else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.5e+137) || !(z <= 4.45e+142)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6.5e+137) || ~((z <= 4.45e+142))) tmp = x + t; else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.5e+137], N[Not[LessEqual[z, 4.45e+142]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+137} \lor \neg \left(z \leq 4.45 \cdot 10^{+142}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -6.5000000000000002e137 or 4.45000000000000008e142 < z Initial program 65.0%
associate-/l*92.2%
Simplified92.2%
Taylor expanded in z around inf 89.7%
if -6.5000000000000002e137 < z < 4.45000000000000008e142Initial program 94.1%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in y around inf 85.8%
associate-/l*89.1%
Simplified89.1%
Final simplification89.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -7800000000000.0) (+ x (* t (/ z (- z a)))) (if (<= z 1.5e+50) (+ x (* y (/ t (- a z)))) (+ x (* t (/ (- z y) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7800000000000.0) {
tmp = x + (t * (z / (z - a)));
} else if (z <= 1.5e+50) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (t * ((z - y) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-7800000000000.0d0)) then
tmp = x + (t * (z / (z - a)))
else if (z <= 1.5d+50) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (t * ((z - y) / 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 <= -7800000000000.0) {
tmp = x + (t * (z / (z - a)));
} else if (z <= 1.5e+50) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (t * ((z - y) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7800000000000.0: tmp = x + (t * (z / (z - a))) elif z <= 1.5e+50: tmp = x + (y * (t / (a - z))) else: tmp = x + (t * ((z - y) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7800000000000.0) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); elseif (z <= 1.5e+50) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(t * Float64(Float64(z - y) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7800000000000.0) tmp = x + (t * (z / (z - a))); elseif (z <= 1.5e+50) tmp = x + (y * (t / (a - z))); else tmp = x + (t * ((z - y) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7800000000000.0], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+50], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7800000000000:\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+50}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{z - y}{z}\\
\end{array}
\end{array}
if z < -7.8e12Initial program 75.3%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in y around 0 69.9%
associate-*r/69.9%
mul-1-neg69.9%
distribute-rgt-neg-out69.9%
associate-*l/86.4%
*-commutative86.4%
distribute-lft-neg-out86.4%
distribute-rgt-neg-in86.4%
distribute-frac-neg286.4%
neg-sub086.4%
sub-neg86.4%
+-commutative86.4%
associate--r+86.4%
neg-sub086.4%
remove-double-neg86.4%
Simplified86.4%
clear-num86.3%
un-div-inv86.4%
Applied egg-rr86.4%
associate-/r/89.9%
Simplified89.9%
if -7.8e12 < z < 1.4999999999999999e50Initial program 94.7%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in y around inf 95.0%
if 1.4999999999999999e50 < z Initial program 79.0%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in a around 0 73.6%
mul-1-neg73.6%
unsub-neg73.6%
associate-/l*92.9%
Simplified92.9%
Final simplification93.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1800000000000.0) (+ x (* z (/ t (- z a)))) (if (<= z 2.1e+141) (+ x (* y (/ t (- a z)))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1800000000000.0) {
tmp = x + (z * (t / (z - a)));
} else if (z <= 2.1e+141) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + 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 <= (-1800000000000.0d0)) then
tmp = x + (z * (t / (z - a)))
else if (z <= 2.1d+141) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + 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 <= -1800000000000.0) {
tmp = x + (z * (t / (z - a)));
} else if (z <= 2.1e+141) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1800000000000.0: tmp = x + (z * (t / (z - a))) elif z <= 2.1e+141: tmp = x + (y * (t / (a - z))) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1800000000000.0) tmp = Float64(x + Float64(z * Float64(t / Float64(z - a)))); elseif (z <= 2.1e+141) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1800000000000.0) tmp = x + (z * (t / (z - a))); elseif (z <= 2.1e+141) tmp = x + (y * (t / (a - z))); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1800000000000.0], N[(x + N[(z * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e+141], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1800000000000:\\
\;\;\;\;x + z \cdot \frac{t}{z - a}\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{+141}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.8e12Initial program 75.3%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in y around 0 69.9%
associate-*r/69.9%
mul-1-neg69.9%
distribute-rgt-neg-out69.9%
associate-*l/86.4%
*-commutative86.4%
distribute-lft-neg-out86.4%
distribute-rgt-neg-in86.4%
distribute-frac-neg286.4%
neg-sub086.4%
sub-neg86.4%
+-commutative86.4%
associate--r+86.4%
neg-sub086.4%
remove-double-neg86.4%
Simplified86.4%
if -1.8e12 < z < 2.0999999999999998e141Initial program 94.8%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in y around inf 92.6%
if 2.0999999999999998e141 < z Initial program 68.2%
associate-/l*91.1%
Simplified91.1%
Taylor expanded in z around inf 91.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.2e-50) (not (<= z 1.55e+50))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e-50) || !(z <= 1.55e+50)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.2d-50)) .or. (.not. (z <= 1.55d+50))) then
tmp = x + t
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e-50) || !(z <= 1.55e+50)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.2e-50) or not (z <= 1.55e+50): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.2e-50) || !(z <= 1.55e+50)) tmp = Float64(x + t); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.2e-50) || ~((z <= 1.55e+50))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.2e-50], N[Not[LessEqual[z, 1.55e+50]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-50} \lor \neg \left(z \leq 1.55 \cdot 10^{+50}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.20000000000000001e-50 or 1.55000000000000001e50 < z Initial program 79.6%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in z around inf 75.6%
if -1.20000000000000001e-50 < z < 1.55000000000000001e50Initial program 94.2%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in z around 0 80.6%
associate-/l*85.2%
Simplified85.2%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.8e+39) (not (<= z 1.1e+50))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.8e+39) || !(z <= 1.1e+50)) {
tmp = x + t;
} 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 <= (-4.8d+39)) .or. (.not. (z <= 1.1d+50))) then
tmp = x + t
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 <= -4.8e+39) || !(z <= 1.1e+50)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.8e+39) or not (z <= 1.1e+50): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.8e+39) || !(z <= 1.1e+50)) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.8e+39) || ~((z <= 1.1e+50))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.8e+39], N[Not[LessEqual[z, 1.1e+50]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+39} \lor \neg \left(z \leq 1.1 \cdot 10^{+50}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.8000000000000002e39 or 1.10000000000000008e50 < z Initial program 74.7%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in z around inf 80.0%
if -4.8000000000000002e39 < z < 1.10000000000000008e50Initial program 95.1%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in x around inf 57.4%
Final simplification66.3%
(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 87.0%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in x around inf 54.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} 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) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
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) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024181
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (if (< t -10682974490174067/10000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 312887599100691/80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t)))))
(+ x (/ (* (- y z) t) (- a z))))