
(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 11 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 (* (/ (- 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(Float64(y - z) / Float64(a - 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[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - z}{a - z} \cdot t
\end{array}
Initial program 83.1%
associate-*l/98.5%
Simplified98.5%
Final simplification98.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ (- z) t)))))
(if (<= z -6e+175)
(+ x t)
(if (<= z -2.35e+39)
t_1
(if (<= z 5000000.0)
(+ x (/ y (/ a t)))
(if (<= z 8e+121) t_1 (+ x t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / (-z / t));
double tmp;
if (z <= -6e+175) {
tmp = x + t;
} else if (z <= -2.35e+39) {
tmp = t_1;
} else if (z <= 5000000.0) {
tmp = x + (y / (a / t));
} else if (z <= 8e+121) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (y / (-z / t))
if (z <= (-6d+175)) then
tmp = x + t
else if (z <= (-2.35d+39)) then
tmp = t_1
else if (z <= 5000000.0d0) then
tmp = x + (y / (a / t))
else if (z <= 8d+121) then
tmp = t_1
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 t_1 = x + (y / (-z / t));
double tmp;
if (z <= -6e+175) {
tmp = x + t;
} else if (z <= -2.35e+39) {
tmp = t_1;
} else if (z <= 5000000.0) {
tmp = x + (y / (a / t));
} else if (z <= 8e+121) {
tmp = t_1;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / (-z / t)) tmp = 0 if z <= -6e+175: tmp = x + t elif z <= -2.35e+39: tmp = t_1 elif z <= 5000000.0: tmp = x + (y / (a / t)) elif z <= 8e+121: tmp = t_1 else: tmp = x + t return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(Float64(-z) / t))) tmp = 0.0 if (z <= -6e+175) tmp = Float64(x + t); elseif (z <= -2.35e+39) tmp = t_1; elseif (z <= 5000000.0) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 8e+121) tmp = t_1; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / (-z / t)); tmp = 0.0; if (z <= -6e+175) tmp = x + t; elseif (z <= -2.35e+39) tmp = t_1; elseif (z <= 5000000.0) tmp = x + (y / (a / t)); elseif (z <= 8e+121) tmp = t_1; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y / N[((-z) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+175], N[(x + t), $MachinePrecision], If[LessEqual[z, -2.35e+39], t$95$1, If[LessEqual[z, 5000000.0], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e+121], t$95$1, N[(x + t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{-z}{t}}\\
\mathbf{if}\;z \leq -6 \cdot 10^{+175}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{+39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5000000:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -6.0000000000000003e175 or 8.0000000000000003e121 < z Initial program 53.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 95.2%
if -6.0000000000000003e175 < z < -2.35e39 or 5e6 < z < 8.0000000000000003e121Initial program 83.3%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around inf 72.3%
associate-/l*81.5%
Simplified81.5%
Taylor expanded in a around 0 75.5%
neg-mul-175.5%
distribute-neg-frac75.5%
Simplified75.5%
if -2.35e39 < z < 5e6Initial program 95.3%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in z around 0 78.8%
associate-/l*82.0%
Simplified82.0%
Final simplification83.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* t (/ y z)))))
(if (<= z -2e+174)
(+ x t)
(if (<= z -5.1e+38)
t_1
(if (<= z 3900000.0)
(+ x (/ y (/ a t)))
(if (<= z 1.85e+121) t_1 (+ x t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (y / z));
double tmp;
if (z <= -2e+174) {
tmp = x + t;
} else if (z <= -5.1e+38) {
tmp = t_1;
} else if (z <= 3900000.0) {
tmp = x + (y / (a / t));
} else if (z <= 1.85e+121) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x - (t * (y / z))
if (z <= (-2d+174)) then
tmp = x + t
else if (z <= (-5.1d+38)) then
tmp = t_1
else if (z <= 3900000.0d0) then
tmp = x + (y / (a / t))
else if (z <= 1.85d+121) then
tmp = t_1
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 t_1 = x - (t * (y / z));
double tmp;
if (z <= -2e+174) {
tmp = x + t;
} else if (z <= -5.1e+38) {
tmp = t_1;
} else if (z <= 3900000.0) {
tmp = x + (y / (a / t));
} else if (z <= 1.85e+121) {
tmp = t_1;
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (t * (y / z)) tmp = 0 if z <= -2e+174: tmp = x + t elif z <= -5.1e+38: tmp = t_1 elif z <= 3900000.0: tmp = x + (y / (a / t)) elif z <= 1.85e+121: tmp = t_1 else: tmp = x + t return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(t * Float64(y / z))) tmp = 0.0 if (z <= -2e+174) tmp = Float64(x + t); elseif (z <= -5.1e+38) tmp = t_1; elseif (z <= 3900000.0) tmp = Float64(x + Float64(y / Float64(a / t))); elseif (z <= 1.85e+121) tmp = t_1; else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (t * (y / z)); tmp = 0.0; if (z <= -2e+174) tmp = x + t; elseif (z <= -5.1e+38) tmp = t_1; elseif (z <= 3900000.0) tmp = x + (y / (a / t)); elseif (z <= 1.85e+121) tmp = t_1; else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+174], N[(x + t), $MachinePrecision], If[LessEqual[z, -5.1e+38], t$95$1, If[LessEqual[z, 3900000.0], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+121], t$95$1, N[(x + t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - t \cdot \frac{y}{z}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+174}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -5.1 \cdot 10^{+38}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3900000:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.00000000000000014e174 or 1.85000000000000006e121 < z Initial program 53.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 95.2%
if -2.00000000000000014e174 < z < -5.1000000000000001e38 or 3.9e6 < z < 1.85000000000000006e121Initial program 83.3%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in y around inf 81.4%
Taylor expanded in a around 0 75.4%
associate-*r/75.4%
neg-mul-175.4%
Simplified75.4%
if -5.1000000000000001e38 < z < 3.9e6Initial program 95.3%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in z around 0 78.8%
associate-/l*82.0%
Simplified82.0%
Final simplification83.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.3e+86) (not (<= z 6800000000.0))) (+ x (* t (- 1.0 (/ y z)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e+86) || !(z <= 6800000000.0)) {
tmp = x + (t * (1.0 - (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 <= (-4.3d+86)) .or. (.not. (z <= 6800000000.0d0))) then
tmp = x + (t * (1.0d0 - (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 <= -4.3e+86) || !(z <= 6800000000.0)) {
tmp = x + (t * (1.0 - (y / z)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.3e+86) or not (z <= 6800000000.0): tmp = x + (t * (1.0 - (y / z))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.3e+86) || !(z <= 6800000000.0)) tmp = Float64(x + Float64(t * Float64(1.0 - 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 <= -4.3e+86) || ~((z <= 6800000000.0))) tmp = x + (t * (1.0 - (y / z))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.3e+86], N[Not[LessEqual[z, 6800000000.0]], $MachinePrecision]], N[(x + N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+86} \lor \neg \left(z \leq 6800000000\right):\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -4.3000000000000002e86 or 6.8e9 < z Initial program 66.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in a around 0 91.7%
associate-*r/91.7%
neg-mul-191.7%
neg-sub091.7%
associate--r-91.7%
neg-sub091.7%
Simplified91.7%
Taylor expanded in y around 0 91.7%
+-commutative91.7%
mul-1-neg91.7%
unsub-neg91.7%
Simplified91.7%
if -4.3000000000000002e86 < z < 6.8e9Initial program 93.8%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in z around 0 77.5%
associate-/l*81.2%
Simplified81.2%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.6e+175) (not (<= z 1.6e+68))) (+ x (* t (- 1.0 (/ y z)))) (+ x (* t (/ y (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.6e+175) || !(z <= 1.6e+68)) {
tmp = x + (t * (1.0 - (y / z)));
} 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 <= (-9.6d+175)) .or. (.not. (z <= 1.6d+68))) then
tmp = x + (t * (1.0d0 - (y / z)))
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 <= -9.6e+175) || !(z <= 1.6e+68)) {
tmp = x + (t * (1.0 - (y / z)));
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.6e+175) or not (z <= 1.6e+68): tmp = x + (t * (1.0 - (y / z))) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.6e+175) || !(z <= 1.6e+68)) tmp = Float64(x + Float64(t * Float64(1.0 - Float64(y / z)))); 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 <= -9.6e+175) || ~((z <= 1.6e+68))) tmp = x + (t * (1.0 - (y / z))); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.6e+175], N[Not[LessEqual[z, 1.6e+68]], $MachinePrecision]], N[(x + N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{+175} \lor \neg \left(z \leq 1.6 \cdot 10^{+68}\right):\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if z < -9.6e175 or 1.59999999999999997e68 < z Initial program 59.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in a around 0 97.8%
associate-*r/97.8%
neg-mul-197.8%
neg-sub097.8%
associate--r-97.8%
neg-sub097.8%
Simplified97.8%
Taylor expanded in y around 0 97.8%
+-commutative97.8%
mul-1-neg97.8%
unsub-neg97.8%
Simplified97.8%
if -9.6e175 < z < 1.59999999999999997e68Initial program 92.3%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in y around inf 88.2%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.3e+174) (not (<= z 1.6e+68))) (+ x (* t (- 1.0 (/ y z)))) (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.3e+174) || !(z <= 1.6e+68)) {
tmp = x + (t * (1.0 - (y / z)));
} else {
tmp = x + (y / ((a - z) / 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 <= (-2.3d+174)) .or. (.not. (z <= 1.6d+68))) then
tmp = x + (t * (1.0d0 - (y / z)))
else
tmp = x + (y / ((a - z) / 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 <= -2.3e+174) || !(z <= 1.6e+68)) {
tmp = x + (t * (1.0 - (y / z)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.3e+174) or not (z <= 1.6e+68): tmp = x + (t * (1.0 - (y / z))) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.3e+174) || !(z <= 1.6e+68)) tmp = Float64(x + Float64(t * Float64(1.0 - Float64(y / z)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.3e+174) || ~((z <= 1.6e+68))) tmp = x + (t * (1.0 - (y / z))); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.3e+174], N[Not[LessEqual[z, 1.6e+68]], $MachinePrecision]], N[(x + N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+174} \lor \neg \left(z \leq 1.6 \cdot 10^{+68}\right):\\
\;\;\;\;x + t \cdot \left(1 - \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -2.2999999999999998e174 or 1.59999999999999997e68 < z Initial program 59.0%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in a around 0 97.8%
associate-*r/97.8%
neg-mul-197.8%
neg-sub097.8%
associate--r-97.8%
neg-sub097.8%
Simplified97.8%
Taylor expanded in y around 0 97.8%
+-commutative97.8%
mul-1-neg97.8%
unsub-neg97.8%
Simplified97.8%
if -2.2999999999999998e174 < z < 1.59999999999999997e68Initial program 92.3%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in y around inf 84.6%
associate-/l*89.2%
Simplified89.2%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.4e+111) (not (<= y 2.35e+25))) (+ x (/ y (/ (- a z) t))) (- x (* t (/ z (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.4e+111) || !(y <= 2.35e+25)) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x - (t * (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 ((y <= (-1.4d+111)) .or. (.not. (y <= 2.35d+25))) then
tmp = x + (y / ((a - z) / t))
else
tmp = x - (t * (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 ((y <= -1.4e+111) || !(y <= 2.35e+25)) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x - (t * (z / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.4e+111) or not (y <= 2.35e+25): tmp = x + (y / ((a - z) / t)) else: tmp = x - (t * (z / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.4e+111) || !(y <= 2.35e+25)) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); else tmp = Float64(x - Float64(t * Float64(z / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.4e+111) || ~((y <= 2.35e+25))) tmp = x + (y / ((a - z) / t)); else tmp = x - (t * (z / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.4e+111], N[Not[LessEqual[y, 2.35e+25]], $MachinePrecision]], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+111} \lor \neg \left(y \leq 2.35 \cdot 10^{+25}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{z}{a - z}\\
\end{array}
\end{array}
if y < -1.4e111 or 2.3499999999999999e25 < y Initial program 80.0%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in y around inf 74.4%
associate-/l*90.8%
Simplified90.8%
if -1.4e111 < y < 2.3499999999999999e25Initial program 84.8%
associate-*l/98.8%
Simplified98.8%
Taylor expanded in y around 0 92.3%
neg-mul-192.3%
distribute-neg-frac92.3%
Simplified92.3%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4e+86) (not (<= z 1420000000.0))) (+ x t) (+ x (* z (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e+86) || !(z <= 1420000000.0)) {
tmp = x + t;
} else {
tmp = x + (z * (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 <= (-4d+86)) .or. (.not. (z <= 1420000000.0d0))) then
tmp = x + t
else
tmp = x + (z * (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 <= -4e+86) || !(z <= 1420000000.0)) {
tmp = x + t;
} else {
tmp = x + (z * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4e+86) or not (z <= 1420000000.0): tmp = x + t else: tmp = x + (z * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4e+86) || !(z <= 1420000000.0)) tmp = Float64(x + t); else tmp = Float64(x + Float64(z * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4e+86) || ~((z <= 1420000000.0))) tmp = x + t; else tmp = x + (z * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4e+86], N[Not[LessEqual[z, 1420000000.0]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(z * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+86} \lor \neg \left(z \leq 1420000000\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -4.0000000000000001e86 or 1.42e9 < z Initial program 66.6%
associate-*l/99.9%
Simplified99.9%
Taylor expanded in z around inf 78.4%
if -4.0000000000000001e86 < z < 1.42e9Initial program 93.8%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in a around inf 80.4%
associate-/l*83.0%
Simplified83.0%
Taylor expanded in y around 0 64.3%
associate-*r/64.3%
neg-mul-164.3%
Simplified64.3%
associate-/r/64.3%
add-sqr-sqrt36.1%
sqrt-unprod56.9%
sqr-neg56.9%
sqrt-unprod28.8%
add-sqr-sqrt64.5%
Applied egg-rr64.5%
Final simplification70.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2e+174) (not (<= z 35000000000000.0))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2e+174) || !(z <= 35000000000000.0)) {
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 <= (-2d+174)) .or. (.not. (z <= 35000000000000.0d0))) 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 <= -2e+174) || !(z <= 35000000000000.0)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2e+174) or not (z <= 35000000000000.0): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2e+174) || !(z <= 35000000000000.0)) 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 <= -2e+174) || ~((z <= 35000000000000.0))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2e+174], N[Not[LessEqual[z, 35000000000000.0]], $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 -2 \cdot 10^{+174} \lor \neg \left(z \leq 35000000000000\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.00000000000000014e174 or 3.5e13 < z Initial program 62.3%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 86.4%
if -2.00000000000000014e174 < z < 3.5e13Initial program 92.8%
associate-*l/97.7%
Simplified97.7%
Taylor expanded in z around 0 75.7%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -2e+174) (+ x t) (if (<= z 4e+20) (+ x (/ y (/ a t))) (+ x t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+174) {
tmp = x + t;
} else if (z <= 4e+20) {
tmp = x + (y / (a / t));
} 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 <= (-2d+174)) then
tmp = x + t
else if (z <= 4d+20) then
tmp = x + (y / (a / t))
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 <= -2e+174) {
tmp = x + t;
} else if (z <= 4e+20) {
tmp = x + (y / (a / t));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e+174: tmp = x + t elif z <= 4e+20: tmp = x + (y / (a / t)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+174) tmp = Float64(x + t); elseif (z <= 4e+20) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2e+174) tmp = x + t; elseif (z <= 4e+20) tmp = x + (y / (a / t)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+174], N[(x + t), $MachinePrecision], If[LessEqual[z, 4e+20], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+174}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+20}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.00000000000000014e174 or 4e20 < z Initial program 62.3%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in z around inf 86.4%
if -2.00000000000000014e174 < z < 4e20Initial program 92.8%
associate-*l/97.7%
Simplified97.7%
Taylor expanded in z around 0 73.9%
associate-/l*77.2%
Simplified77.2%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (+ x t))
double code(double x, double y, double z, double t, double a) {
return x + 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 + t
end function
public static double code(double x, double y, double z, double t, double a) {
return x + t;
}
def code(x, y, z, t, a): return x + t
function code(x, y, z, t, a) return Float64(x + t) end
function tmp = code(x, y, z, t, a) tmp = x + t; end
code[x_, y_, z_, t_, a_] := N[(x + t), $MachinePrecision]
\begin{array}{l}
\\
x + t
\end{array}
Initial program 83.1%
associate-*l/98.5%
Simplified98.5%
Taylor expanded in z around inf 59.2%
Final simplification59.2%
(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 2023199
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))