
(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.3e+18) (not (<= t 8e+81))) (+ y x) (+ x (* y (/ (- z t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.3e+18) || !(t <= 8e+81)) {
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.3d+18)) .or. (.not. (t <= 8d+81))) 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.3e+18) || !(t <= 8e+81)) {
tmp = y + x;
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.3e+18) or not (t <= 8e+81): 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.3e+18) || !(t <= 8e+81)) 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.3e+18) || ~((t <= 8e+81))) 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.3e+18], N[Not[LessEqual[t, 8e+81]], $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.3 \cdot 10^{+18} \lor \neg \left(t \leq 8 \cdot 10^{+81}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if t < -1.3e18 or 7.99999999999999937e81 < t Initial program 99.9%
Taylor expanded in t around inf 81.2%
+-commutative81.2%
Simplified81.2%
if -1.3e18 < t < 7.99999999999999937e81Initial 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.2e+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.2e+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.2d+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.2e+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.2e+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.2e+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.2e+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.2e+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.2 \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.19999999999999983e50 or 3.60000000000000015e237 < t Initial program 99.9%
Taylor expanded in t around inf 85.3%
+-commutative85.3%
Simplified85.3%
if -3.19999999999999983e50 < 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 -2.3e+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 <= -2.3e+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 <= (-2.3d+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 <= -2.3e+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 <= -2.3e+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 <= -2.3e+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 <= -2.3e+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, -2.3e+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 -2.3 \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 < -2.29999999999999997e50 or 3.60000000000000015e237 < t Initial program 99.9%
Taylor expanded in t around inf 85.3%
+-commutative85.3%
Simplified85.3%
if -2.29999999999999997e50 < 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 -3.25e+50) (+ y x) (if (<= t 2.6e+140) (+ 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 <= -3.25e+50) {
tmp = y + x;
} else if (t <= 2.6e+140) {
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 <= (-3.25d+50)) then
tmp = y + x
else if (t <= 2.6d+140) 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 <= -3.25e+50) {
tmp = y + x;
} else if (t <= 2.6e+140) {
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 <= -3.25e+50: tmp = y + x elif t <= 2.6e+140: 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 <= -3.25e+50) tmp = Float64(y + x); elseif (t <= 2.6e+140) 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 <= -3.25e+50) tmp = y + x; elseif (t <= 2.6e+140) 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, -3.25e+50], N[(y + x), $MachinePrecision], If[LessEqual[t, 2.6e+140], 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 -3.25 \cdot 10^{+50}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+140}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{1}{\frac{1}{y}}\\
\end{array}
\end{array}
if t < -3.2500000000000001e50Initial program 99.8%
Taylor expanded in t around inf 81.8%
+-commutative81.8%
Simplified81.8%
if -3.2500000000000001e50 < t < 2.6000000000000001e140Initial 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 2.6000000000000001e140 < 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 -2.1e-16) (+ x (* (/ y t) (- t z))) (if (<= t 7.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.1e-16) {
tmp = x + ((y / t) * (t - z));
} else if (t <= 7.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.1d-16)) then
tmp = x + ((y / t) * (t - z))
else if (t <= 7.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.1e-16) {
tmp = x + ((y / t) * (t - z));
} else if (t <= 7.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.1e-16: tmp = x + ((y / t) * (t - z)) elif t <= 7.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.1e-16) tmp = Float64(x + Float64(Float64(y / t) * Float64(t - z))); elseif (t <= 7.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.1e-16) tmp = x + ((y / t) * (t - z)); elseif (t <= 7.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.1e-16], N[(x + N[(N[(y / t), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.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.1 \cdot 10^{-16}:\\
\;\;\;\;x + \frac{y}{t} \cdot \left(t - z\right)\\
\mathbf{elif}\;t \leq 7.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.1000000000000001e-16Initial 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 -2.1000000000000001e-16 < t < 7.49999999999999947e135Initial 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 7.49999999999999947e135 < 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 -3.5e+23) (+ x (/ z (/ (- a t) y))) (if (<= z 0.00086) (- 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 <= -3.5e+23) {
tmp = x + (z / ((a - t) / y));
} else if (z <= 0.00086) {
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 <= (-3.5d+23)) then
tmp = x + (z / ((a - t) / y))
else if (z <= 0.00086d0) 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 <= -3.5e+23) {
tmp = x + (z / ((a - t) / y));
} else if (z <= 0.00086) {
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 <= -3.5e+23: tmp = x + (z / ((a - t) / y)) elif z <= 0.00086: 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 <= -3.5e+23) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); elseif (z <= 0.00086) 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 <= -3.5e+23) tmp = x + (z / ((a - t) / y)); elseif (z <= 0.00086) 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, -3.5e+23], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.00086], 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 -3.5 \cdot 10^{+23}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{elif}\;z \leq 0.00086:\\
\;\;\;\;x - t \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if z < -3.5000000000000002e23Initial 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.5000000000000002e23 < z < 8.59999999999999979e-4Initial program 99.9%
Taylor expanded in z around 0 83.2%
mul-1-neg83.2%
unsub-neg83.2%
associate-/l*86.4%
Simplified86.4%
clear-num86.3%
associate-/r/86.1%
clear-num86.2%
Applied egg-rr86.2%
if 8.59999999999999979e-4 < z Initial program 93.5%
Taylor expanded in z around inf 75.0%
associate-/l*79.8%
Simplified79.8%
Final simplification84.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- a t) y)))
(if (<= z -4.2e+23)
(+ x (/ z t_1))
(if (<= z 0.0065) (- 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 <= -4.2e+23) {
tmp = x + (z / t_1);
} else if (z <= 0.0065) {
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 <= (-4.2d+23)) then
tmp = x + (z / t_1)
else if (z <= 0.0065d0) 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 <= -4.2e+23) {
tmp = x + (z / t_1);
} else if (z <= 0.0065) {
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 <= -4.2e+23: tmp = x + (z / t_1) elif z <= 0.0065: 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 <= -4.2e+23) tmp = Float64(x + Float64(z / t_1)); elseif (z <= 0.0065) 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 <= -4.2e+23) tmp = x + (z / t_1); elseif (z <= 0.0065) 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, -4.2e+23], N[(x + N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.0065], 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 -4.2 \cdot 10^{+23}:\\
\;\;\;\;x + \frac{z}{t\_1}\\
\mathbf{elif}\;z \leq 0.0065:\\
\;\;\;\;x - \frac{t}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if z < -4.2000000000000003e23Initial 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.2000000000000003e23 < z < 0.0064999999999999997Initial program 99.9%
Taylor expanded in z around 0 83.2%
mul-1-neg83.2%
unsub-neg83.2%
associate-/l*86.4%
Simplified86.4%
if 0.0064999999999999997 < z Initial program 93.5%
Taylor expanded in z around inf 75.0%
associate-/l*79.8%
Simplified79.8%
Final simplification84.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -3e+23) (+ x (/ z (/ (- a t) y))) (if (<= z 0.155) (- 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.155) {
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.155d0) 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.155) {
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.155: 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.155) 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.155) 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.155], 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.155:\\
\;\;\;\;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.154999999999999999Initial program 99.9%
Taylor expanded in z around 0 91.3%
neg-mul-191.3%
distribute-neg-frac91.3%
Simplified91.3%
if 0.154999999999999999 < z Initial program 93.5%
Taylor expanded in z around inf 75.0%
associate-/l*79.8%
Simplified79.8%
Final simplification87.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2e+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 <= -2e+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 <= (-2d+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 <= -2e+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 <= -2e+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 <= -2e+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 <= -2e+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, -2e+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 \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 < -2e21 or 1.20000000000000003e-73 < a Initial program 99.8%
Taylor expanded in t around 0 79.9%
if -2e21 < a < 1.20000000000000003e-73Initial program 94.3%
Taylor expanded in t around inf 65.3%
+-commutative65.3%
Simplified65.3%
Final simplification73.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.05e+21) x (if (<= a 9e+175) (+ 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 <= 9e+175) {
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 <= 9d+175) 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 <= 9e+175) {
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 <= 9e+175: 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 <= 9e+175) 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 <= 9e+175) 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, 9e+175], 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 9 \cdot 10^{+175}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.05e21 or 8.99999999999999979e175 < a Initial program 99.8%
Taylor expanded in x around inf 65.8%
if -2.05e21 < a < 8.99999999999999979e175Initial program 96.0%
Taylor expanded in t around inf 63.7%
+-commutative63.7%
Simplified63.7%
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)))))