
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (a - t)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ (- z t) (- a t))))) (if (<= t_1 (- INFINITY)) (+ x (/ z (/ (- a t) y))) (+ t_1 x))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = t_1 + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (a - t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = t_1 + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z - t) / (a - t)) tmp = 0 if t_1 <= -math.inf: tmp = x + (z / ((a - t) / y)) else: tmp = t_1 + x return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(a - t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); else tmp = Float64(t_1 + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z - t) / (a - t)); tmp = 0.0; if (t_1 <= -Inf) tmp = x + (z / ((a - t) / y)); else tmp = t_1 + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) < -inf.0Initial program 59.1%
Taylor expanded in z around inf 99.9%
*-commutative99.9%
associate-/l*99.9%
associate-/r/59.1%
Simplified59.1%
associate-*l/99.9%
associate-/l*99.9%
Applied egg-rr99.9%
if -inf.0 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 a t))) Initial program 99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.9e+19) (not (<= t 5.6e+79))) (+ y x) (+ x (* y (/ (- z t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.9e+19) || !(t <= 5.6e+79)) {
tmp = y + x;
} else {
tmp = x + (y * ((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 ((t <= (-1.9d+19)) .or. (.not. (t <= 5.6d+79))) then
tmp = y + x
else
tmp = x + (y * ((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 ((t <= -1.9e+19) || !(t <= 5.6e+79)) {
tmp = y + x;
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.9e+19) or not (t <= 5.6e+79): tmp = y + x else: tmp = x + (y * ((z - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.9e+19) || !(t <= 5.6e+79)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.9e+19) || ~((t <= 5.6e+79))) tmp = y + x; else tmp = x + (y * ((z - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.9e+19], N[Not[LessEqual[t, 5.6e+79]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{+19} \lor \neg \left(t \leq 5.6 \cdot 10^{+79}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if t < -1.9e19 or 5.6000000000000002e79 < t Initial program 99.9%
Taylor expanded in t around inf 81.2%
+-commutative81.2%
Simplified81.2%
if -1.9e19 < t < 5.6000000000000002e79Initial program 95.7%
Taylor expanded in a around inf 78.5%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.3e+50) (not (<= t 3.6e+237))) (+ y x) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.3e+50) || !(t <= 3.6e+237)) {
tmp = y + x;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3.3d+50)) .or. (.not. (t <= 3.6d+237))) then
tmp = y + x
else
tmp = x + (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.3e+50) || !(t <= 3.6e+237)) {
tmp = y + x;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.3e+50) or not (t <= 3.6e+237): tmp = y + x else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.3e+50) || !(t <= 3.6e+237)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.3e+50) || ~((t <= 3.6e+237))) tmp = y + x; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.3e+50], N[Not[LessEqual[t, 3.6e+237]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{+50} \lor \neg \left(t \leq 3.6 \cdot 10^{+237}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -3.3e50 or 3.60000000000000015e237 < t Initial program 99.9%
Taylor expanded in t around inf 85.3%
+-commutative85.3%
Simplified85.3%
if -3.3e50 < t < 3.60000000000000015e237Initial program 96.4%
Taylor expanded in z around inf 80.4%
*-commutative80.4%
associate-/l*82.3%
associate-/r/81.3%
Simplified81.3%
Final simplification82.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.1e+50) (not (<= t 3.6e+237))) (+ y x) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.1e+50) || !(t <= 3.6e+237)) {
tmp = y + x;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3.1d+50)) .or. (.not. (t <= 3.6d+237))) then
tmp = y + x
else
tmp = x + (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.1e+50) || !(t <= 3.6e+237)) {
tmp = y + x;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.1e+50) or not (t <= 3.6e+237): tmp = y + x else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.1e+50) || !(t <= 3.6e+237)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.1e+50) || ~((t <= 3.6e+237))) tmp = y + x; else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.1e+50], N[Not[LessEqual[t, 3.6e+237]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.1 \cdot 10^{+50} \lor \neg \left(t \leq 3.6 \cdot 10^{+237}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -3.10000000000000003e50 or 3.60000000000000015e237 < t Initial program 99.9%
Taylor expanded in t around inf 85.3%
+-commutative85.3%
Simplified85.3%
if -3.10000000000000003e50 < t < 3.60000000000000015e237Initial program 96.4%
Taylor expanded in z around inf 80.4%
associate-/l*81.8%
Simplified81.8%
Final simplification82.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.15e+50) (+ y x) (if (<= t 8.5e+135) (+ x (/ z (/ (- a t) y))) (+ x (/ 1.0 (/ 1.0 y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.15e+50) {
tmp = y + x;
} else if (t <= 8.5e+135) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x + (1.0 / (1.0 / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-2.15d+50)) then
tmp = y + x
else if (t <= 8.5d+135) then
tmp = x + (z / ((a - t) / y))
else
tmp = x + (1.0d0 / (1.0d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.15e+50) {
tmp = y + x;
} else if (t <= 8.5e+135) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x + (1.0 / (1.0 / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.15e+50: tmp = y + x elif t <= 8.5e+135: tmp = x + (z / ((a - t) / y)) else: tmp = x + (1.0 / (1.0 / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.15e+50) tmp = Float64(y + x); elseif (t <= 8.5e+135) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); else tmp = Float64(x + Float64(1.0 / Float64(1.0 / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.15e+50) tmp = y + x; elseif (t <= 8.5e+135) tmp = x + (z / ((a - t) / y)); else tmp = x + (1.0 / (1.0 / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.15e+50], N[(y + x), $MachinePrecision], If[LessEqual[t, 8.5e+135], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{+50}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+135}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{1}{y}}\\
\end{array}
\end{array}
if t < -2.1499999999999999e50Initial program 99.8%
Taylor expanded in t around inf 81.8%
+-commutative81.8%
Simplified81.8%
if -2.1499999999999999e50 < t < 8.49999999999999992e135Initial program 96.1%
Taylor expanded in z around inf 81.1%
*-commutative81.1%
associate-/l*83.2%
associate-/r/81.6%
Simplified81.6%
associate-*l/81.1%
associate-/l*83.2%
Applied egg-rr83.2%
if 8.49999999999999992e135 < t Initial program 99.9%
associate-*r/75.4%
clear-num75.6%
associate-/r*85.8%
Applied egg-rr85.8%
Taylor expanded in t around inf 86.4%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.5e-17) (+ x (* (/ y t) (- t z))) (if (<= t 1.05e+136) (+ x (/ z (/ (- a t) y))) (+ x (/ 1.0 (/ 1.0 y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.5e-17) {
tmp = x + ((y / t) * (t - z));
} else if (t <= 1.05e+136) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x + (1.0 / (1.0 / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-6.5d-17)) then
tmp = x + ((y / t) * (t - z))
else if (t <= 1.05d+136) then
tmp = x + (z / ((a - t) / y))
else
tmp = x + (1.0d0 / (1.0d0 / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.5e-17) {
tmp = x + ((y / t) * (t - z));
} else if (t <= 1.05e+136) {
tmp = x + (z / ((a - t) / y));
} else {
tmp = x + (1.0 / (1.0 / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.5e-17: tmp = x + ((y / t) * (t - z)) elif t <= 1.05e+136: tmp = x + (z / ((a - t) / y)) else: tmp = x + (1.0 / (1.0 / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.5e-17) tmp = Float64(x + Float64(Float64(y / t) * Float64(t - z))); elseif (t <= 1.05e+136) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); else tmp = Float64(x + Float64(1.0 / Float64(1.0 / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.5e-17) tmp = x + ((y / t) * (t - z)); elseif (t <= 1.05e+136) tmp = x + (z / ((a - t) / y)); else tmp = x + (1.0 / (1.0 / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.5e-17], N[(x + N[(N[(y / t), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.05e+136], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 / N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(t - z\right)\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+136}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{1}{y}}\\
\end{array}
\end{array}
if t < -6.4999999999999996e-17Initial program 99.8%
Taylor expanded in a around 0 71.4%
mul-1-neg71.4%
unsub-neg71.4%
associate-/l*88.8%
associate-/r/80.6%
Simplified80.6%
if -6.4999999999999996e-17 < t < 1.05e136Initial program 95.7%
Taylor expanded in z around inf 81.6%
*-commutative81.6%
associate-/l*83.9%
associate-/r/82.2%
Simplified82.2%
associate-*l/81.6%
associate-/l*83.9%
Applied egg-rr83.9%
if 1.05e136 < t Initial program 99.9%
associate-*r/75.4%
clear-num75.6%
associate-/r*85.8%
Applied egg-rr85.8%
Taylor expanded in t around inf 86.4%
Final simplification83.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.5e+23) (+ x (/ z (/ (- a t) y))) (if (<= z 0.0006) (- x (* t (/ y (- a t)))) (+ x (/ y (/ (- a t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.5e+23) {
tmp = x + (z / ((a - t) / y));
} else if (z <= 0.0006) {
tmp = x - (t * (y / (a - 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 <= (-4.5d+23)) then
tmp = x + (z / ((a - t) / y))
else if (z <= 0.0006d0) then
tmp = x - (t * (y / (a - 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 <= -4.5e+23) {
tmp = x + (z / ((a - t) / y));
} else if (z <= 0.0006) {
tmp = x - (t * (y / (a - t)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.5e+23: tmp = x + (z / ((a - t) / y)) elif z <= 0.0006: tmp = x - (t * (y / (a - t))) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.5e+23) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); elseif (z <= 0.0006) tmp = Float64(x - Float64(t * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.5e+23) tmp = x + (z / ((a - t) / y)); elseif (z <= 0.0006) tmp = x - (t * (y / (a - t))); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.5e+23], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0006], N[(x - N[(t * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+23}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{elif}\;z \leq 0.0006:\\
\;\;\;\;x - t \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if z < -4.49999999999999979e23Initial program 94.0%
Taylor expanded in z around inf 82.7%
*-commutative82.7%
associate-/l*86.7%
associate-/r/84.7%
Simplified84.7%
associate-*l/82.7%
associate-/l*86.7%
Applied egg-rr86.7%
if -4.49999999999999979e23 < z < 5.99999999999999947e-4Initial program 99.9%
Taylor expanded in z around 0 83.0%
mul-1-neg83.0%
unsub-neg83.0%
associate-/l*86.3%
Simplified86.3%
clear-num86.2%
associate-/r/86.0%
clear-num86.1%
Applied egg-rr86.1%
if 5.99999999999999947e-4 < z Initial program 93.6%
Taylor expanded in z around inf 75.4%
associate-/l*80.1%
Simplified80.1%
Final simplification84.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- a t) y)))
(if (<= z -6e+23)
(+ x (/ z t_1))
(if (<= z 0.0046) (- x (/ t t_1)) (+ x (/ y (/ (- a t) z)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a - t) / y;
double tmp;
if (z <= -6e+23) {
tmp = x + (z / t_1);
} else if (z <= 0.0046) {
tmp = x - (t / t_1);
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (a - t) / y
if (z <= (-6d+23)) then
tmp = x + (z / t_1)
else if (z <= 0.0046d0) then
tmp = x - (t / t_1)
else
tmp = x + (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (a - t) / y;
double tmp;
if (z <= -6e+23) {
tmp = x + (z / t_1);
} else if (z <= 0.0046) {
tmp = x - (t / t_1);
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a - t) / y tmp = 0 if z <= -6e+23: tmp = x + (z / t_1) elif z <= 0.0046: tmp = x - (t / t_1) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a - t) / y) tmp = 0.0 if (z <= -6e+23) tmp = Float64(x + Float64(z / t_1)); elseif (z <= 0.0046) tmp = Float64(x - Float64(t / t_1)); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a - t) / y; tmp = 0.0; if (z <= -6e+23) tmp = x + (z / t_1); elseif (z <= 0.0046) tmp = x - (t / t_1); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[z, -6e+23], N[(x + N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0046], N[(x - N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y}\\
\mathbf{if}\;z \leq -6 \cdot 10^{+23}:\\
\;\;\;\;x + \frac{z}{t\_1}\\
\mathbf{elif}\;z \leq 0.0046:\\
\;\;\;\;x - \frac{t}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if z < -6.0000000000000002e23Initial program 94.0%
Taylor expanded in z around inf 82.7%
*-commutative82.7%
associate-/l*86.7%
associate-/r/84.7%
Simplified84.7%
associate-*l/82.7%
associate-/l*86.7%
Applied egg-rr86.7%
if -6.0000000000000002e23 < z < 0.0045999999999999999Initial program 99.9%
Taylor expanded in z around 0 83.0%
mul-1-neg83.0%
unsub-neg83.0%
associate-/l*86.3%
Simplified86.3%
if 0.0045999999999999999 < z Initial program 93.6%
Taylor expanded in z around inf 75.4%
associate-/l*80.1%
Simplified80.1%
Final simplification84.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -3e+23) (+ x (/ z (/ (- a t) y))) (if (<= z 0.88) (- x (* y (/ t (- a t)))) (+ x (/ y (/ (- a t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3e+23) {
tmp = x + (z / ((a - t) / y));
} else if (z <= 0.88) {
tmp = x - (y * (t / (a - 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 <= (-3d+23)) then
tmp = x + (z / ((a - t) / y))
else if (z <= 0.88d0) then
tmp = x - (y * (t / (a - 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 <= -3e+23) {
tmp = x + (z / ((a - t) / y));
} else if (z <= 0.88) {
tmp = x - (y * (t / (a - t)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3e+23: tmp = x + (z / ((a - t) / y)) elif z <= 0.88: tmp = x - (y * (t / (a - t))) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3e+23) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); elseif (z <= 0.88) tmp = Float64(x - Float64(y * Float64(t / Float64(a - t)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3e+23) tmp = x + (z / ((a - t) / y)); elseif (z <= 0.88) tmp = x - (y * (t / (a - t))); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3e+23], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.88], N[(x - N[(y * N[(t / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+23}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{elif}\;z \leq 0.88:\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if z < -3.0000000000000001e23Initial program 94.0%
Taylor expanded in z around inf 82.7%
*-commutative82.7%
associate-/l*86.7%
associate-/r/84.7%
Simplified84.7%
associate-*l/82.7%
associate-/l*86.7%
Applied egg-rr86.7%
if -3.0000000000000001e23 < z < 0.880000000000000004Initial program 99.9%
Taylor expanded in z around 0 91.3%
neg-mul-191.3%
distribute-neg-frac91.3%
Simplified91.3%
if 0.880000000000000004 < z Initial program 93.6%
Taylor expanded in z around inf 75.4%
associate-/l*80.1%
Simplified80.1%
Final simplification87.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.05e+21) (not (<= a 1.2e-73))) (+ x (* y (/ z a))) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.05e+21) || !(a <= 1.2e-73)) {
tmp = x + (y * (z / 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 ((a <= (-2.05d+21)) .or. (.not. (a <= 1.2d-73))) then
tmp = x + (y * (z / 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 ((a <= -2.05e+21) || !(a <= 1.2e-73)) {
tmp = x + (y * (z / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.05e+21) or not (a <= 1.2e-73): tmp = x + (y * (z / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.05e+21) || !(a <= 1.2e-73)) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.05e+21) || ~((a <= 1.2e-73))) tmp = x + (y * (z / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.05e+21], N[Not[LessEqual[a, 1.2e-73]], $MachinePrecision]], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{+21} \lor \neg \left(a \leq 1.2 \cdot 10^{-73}\right):\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -2.05e21 or 1.20000000000000003e-73 < a Initial program 99.8%
Taylor expanded in t around 0 79.8%
if -2.05e21 < a < 1.20000000000000003e-73Initial program 94.4%
Taylor expanded in t around inf 65.6%
+-commutative65.6%
Simplified65.6%
Final simplification73.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.05e+21) x (if (<= a 1.12e+177) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.05e+21) {
tmp = x;
} else if (a <= 1.12e+177) {
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 <= (-2.05d+21)) then
tmp = x
else if (a <= 1.12d+177) 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 <= -2.05e+21) {
tmp = x;
} else if (a <= 1.12e+177) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.05e+21: tmp = x elif a <= 1.12e+177: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.05e+21) tmp = x; elseif (a <= 1.12e+177) 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 <= -2.05e+21) tmp = x; elseif (a <= 1.12e+177) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.05e+21], x, If[LessEqual[a, 1.12e+177], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.05 \cdot 10^{+21}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.12 \cdot 10^{+177}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.05e21 or 1.1200000000000001e177 < a Initial program 99.8%
Taylor expanded in x around inf 65.4%
if -2.05e21 < a < 1.1200000000000001e177Initial program 96.0%
Taylor expanded in t around inf 64.0%
+-commutative64.0%
Simplified64.0%
Final simplification64.4%
(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 97.3%
Taylor expanded in x around inf 49.4%
Final simplification49.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (y * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024031
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))