
(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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (/ y (- a t)) (- z t) x))
double code(double x, double y, double z, double t, double a) {
return fma((y / (a - t)), (z - t), x);
}
function code(x, y, z, t, a) return fma(Float64(y / Float64(a - t)), Float64(z - t), x) end
code[x_, y_, z_, t_, a_] := N[(N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision] * N[(z - t), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)
\end{array}
Initial program 82.1%
+-commutative82.1%
associate-*l/98.5%
fma-def98.5%
Simplified98.5%
Final simplification98.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- a t))))
(if (<= t_1 (- INFINITY))
(+ x (/ y (/ (- a t) z)))
(if (<= t_1 5e+292) (+ x t_1) (- x (/ y (/ t (- z t))))))))
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 + (y / ((a - t) / z));
} else if (t_1 <= 5e+292) {
tmp = x + t_1;
} else {
tmp = x - (y / (t / (z - t)));
}
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 + (y / ((a - t) / z));
} else if (t_1 <= 5e+292) {
tmp = x + t_1;
} else {
tmp = x - (y / (t / (z - t)));
}
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 + (y / ((a - t) / z)) elif t_1 <= 5e+292: tmp = x + t_1 else: tmp = x - (y / (t / (z - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(a - t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); elseif (t_1 <= 5e+292) tmp = Float64(x + t_1); else tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); 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 + (y / ((a - t) / z)); elseif (t_1 <= 5e+292) tmp = x + t_1; else tmp = x - (y / (t / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+292], N[(x + t$95$1), $MachinePrecision], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0Initial program 36.6%
+-commutative36.6%
associate-*l/99.9%
fma-def99.9%
Simplified99.9%
fma-udef99.9%
associate-*l/36.6%
associate-/l*99.9%
div-inv99.8%
clear-num99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 43.4%
associate-/l*73.2%
Simplified73.2%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 4.9999999999999996e292Initial program 99.9%
if 4.9999999999999996e292 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 32.4%
Taylor expanded in a around 0 22.4%
mul-1-neg22.4%
unsub-neg22.4%
associate-/l*74.6%
Simplified74.6%
Final simplification92.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ y (/ (- a t) z)))))
(if (<= t -1.75e+139)
(+ y x)
(if (<= t -1.6e-165)
t_1
(if (<= t 7.3e-287)
(+ x (/ (- z t) (/ a y)))
(if (<= t 2.25e+73) t_1 (+ y x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y / ((a - t) / z));
double tmp;
if (t <= -1.75e+139) {
tmp = y + x;
} else if (t <= -1.6e-165) {
tmp = t_1;
} else if (t <= 7.3e-287) {
tmp = x + ((z - t) / (a / y));
} else if (t <= 2.25e+73) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x + (y / ((a - t) / z))
if (t <= (-1.75d+139)) then
tmp = y + x
else if (t <= (-1.6d-165)) then
tmp = t_1
else if (t <= 7.3d-287) then
tmp = x + ((z - t) / (a / y))
else if (t <= 2.25d+73) then
tmp = t_1
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 t_1 = x + (y / ((a - t) / z));
double tmp;
if (t <= -1.75e+139) {
tmp = y + x;
} else if (t <= -1.6e-165) {
tmp = t_1;
} else if (t <= 7.3e-287) {
tmp = x + ((z - t) / (a / y));
} else if (t <= 2.25e+73) {
tmp = t_1;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y / ((a - t) / z)) tmp = 0 if t <= -1.75e+139: tmp = y + x elif t <= -1.6e-165: tmp = t_1 elif t <= 7.3e-287: tmp = x + ((z - t) / (a / y)) elif t <= 2.25e+73: tmp = t_1 else: tmp = y + x return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y / Float64(Float64(a - t) / z))) tmp = 0.0 if (t <= -1.75e+139) tmp = Float64(y + x); elseif (t <= -1.6e-165) tmp = t_1; elseif (t <= 7.3e-287) tmp = Float64(x + Float64(Float64(z - t) / Float64(a / y))); elseif (t <= 2.25e+73) tmp = t_1; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y / ((a - t) / z)); tmp = 0.0; if (t <= -1.75e+139) tmp = y + x; elseif (t <= -1.6e-165) tmp = t_1; elseif (t <= 7.3e-287) tmp = x + ((z - t) / (a / y)); elseif (t <= 2.25e+73) tmp = t_1; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.75e+139], N[(y + x), $MachinePrecision], If[LessEqual[t, -1.6e-165], t$95$1, If[LessEqual[t, 7.3e-287], N[(x + N[(N[(z - t), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.25e+73], t$95$1, N[(y + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{if}\;t \leq -1.75 \cdot 10^{+139}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -1.6 \cdot 10^{-165}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 7.3 \cdot 10^{-287}:\\
\;\;\;\;x + \frac{z - t}{\frac{a}{y}}\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{+73}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.74999999999999989e139 or 2.24999999999999992e73 < t Initial program 62.2%
Taylor expanded in t around inf 88.0%
+-commutative88.0%
Simplified88.0%
if -1.74999999999999989e139 < t < -1.60000000000000006e-165 or 7.29999999999999982e-287 < t < 2.24999999999999992e73Initial program 88.6%
+-commutative88.6%
associate-*l/98.5%
fma-def98.5%
Simplified98.5%
fma-udef98.5%
associate-*l/88.6%
associate-/l*98.5%
div-inv98.5%
clear-num98.4%
Applied egg-rr98.4%
Taylor expanded in z around inf 79.4%
associate-/l*88.5%
Simplified88.5%
if -1.60000000000000006e-165 < t < 7.29999999999999982e-287Initial program 97.6%
*-commutative97.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around inf 97.5%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.8e-16) (not (<= t 1.7e+71))) (+ y x) (+ x (* (- z t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.8e-16) || !(t <= 1.7e+71)) {
tmp = y + x;
} else {
tmp = x + ((z - 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 ((t <= (-1.8d-16)) .or. (.not. (t <= 1.7d+71))) then
tmp = y + x
else
tmp = x + ((z - 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 ((t <= -1.8e-16) || !(t <= 1.7e+71)) {
tmp = y + x;
} else {
tmp = x + ((z - t) * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.8e-16) or not (t <= 1.7e+71): tmp = y + x else: tmp = x + ((z - t) * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.8e-16) || !(t <= 1.7e+71)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.8e-16) || ~((t <= 1.7e+71))) tmp = y + x; else tmp = x + ((z - t) * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.8e-16], N[Not[LessEqual[t, 1.7e+71]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-16} \lor \neg \left(t \leq 1.7 \cdot 10^{+71}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.79999999999999991e-16 or 1.6999999999999999e71 < t Initial program 68.8%
Taylor expanded in t around inf 83.3%
+-commutative83.3%
Simplified83.3%
if -1.79999999999999991e-16 < t < 1.6999999999999999e71Initial program 92.5%
+-commutative92.5%
associate-*l/98.6%
fma-def98.6%
Simplified98.6%
fma-udef98.6%
associate-*l/92.5%
associate-/l*94.5%
div-inv93.9%
clear-num94.5%
Applied egg-rr94.5%
Taylor expanded in a around inf 79.7%
*-commutative79.7%
associate-*r/85.7%
Simplified85.7%
Final simplification84.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.75e-16) (not (<= t 2.25e+72))) (- 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 ((t <= -1.75e-16) || !(t <= 2.25e+72)) {
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 ((t <= (-1.75d-16)) .or. (.not. (t <= 2.25d+72))) 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 ((t <= -1.75e-16) || !(t <= 2.25e+72)) {
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 (t <= -1.75e-16) or not (t <= 2.25e+72): 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 ((t <= -1.75e-16) || !(t <= 2.25e+72)) 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 ((t <= -1.75e-16) || ~((t <= 2.25e+72))) 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[Or[LessEqual[t, -1.75e-16], N[Not[LessEqual[t, 2.25e+72]], $MachinePrecision]], 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}\;t \leq -1.75 \cdot 10^{-16} \lor \neg \left(t \leq 2.25 \cdot 10^{+72}\right):\\
\;\;\;\;x - y \cdot \frac{t}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -1.75000000000000009e-16 or 2.2499999999999999e72 < t Initial program 68.8%
Taylor expanded in z around 0 66.0%
mul-1-neg66.0%
associate-*l/90.9%
unsub-neg90.9%
*-commutative90.9%
Simplified90.9%
if -1.75000000000000009e-16 < t < 2.2499999999999999e72Initial program 92.5%
+-commutative92.5%
associate-*l/98.6%
fma-def98.6%
Simplified98.6%
fma-udef98.6%
associate-*l/92.5%
associate-/l*94.5%
div-inv93.9%
clear-num94.5%
Applied egg-rr94.5%
Taylor expanded in z around inf 85.7%
associate-/l*89.9%
Simplified89.9%
Final simplification90.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.6e-16) (+ y x) (if (<= t 5.6e+69) (+ x (/ (- z t) (/ a y))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.6e-16) {
tmp = y + x;
} else if (t <= 5.6e+69) {
tmp = x + ((z - t) / (a / y));
} 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 (t <= (-1.6d-16)) then
tmp = y + x
else if (t <= 5.6d+69) then
tmp = x + ((z - t) / (a / y))
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 (t <= -1.6e-16) {
tmp = y + x;
} else if (t <= 5.6e+69) {
tmp = x + ((z - t) / (a / y));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.6e-16: tmp = y + x elif t <= 5.6e+69: tmp = x + ((z - t) / (a / y)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.6e-16) tmp = Float64(y + x); elseif (t <= 5.6e+69) tmp = Float64(x + Float64(Float64(z - t) / Float64(a / y))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.6e-16) tmp = y + x; elseif (t <= 5.6e+69) tmp = x + ((z - t) / (a / y)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.6e-16], N[(y + x), $MachinePrecision], If[LessEqual[t, 5.6e+69], N[(x + N[(N[(z - t), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-16}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+69}:\\
\;\;\;\;x + \frac{z - t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.60000000000000011e-16 or 5.59999999999999964e69 < t Initial program 68.8%
Taylor expanded in t around inf 83.3%
+-commutative83.3%
Simplified83.3%
if -1.60000000000000011e-16 < t < 5.59999999999999964e69Initial program 92.5%
*-commutative92.5%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in a around inf 85.7%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.45e-16) (not (<= t 4.9e+69))) (+ y x) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.45e-16) || !(t <= 4.9e+69)) {
tmp = y + x;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.45d-16)) .or. (.not. (t <= 4.9d+69))) then
tmp = y + x
else
tmp = x + ((y * z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.45e-16) || !(t <= 4.9e+69)) {
tmp = y + x;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.45e-16) or not (t <= 4.9e+69): tmp = y + x else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.45e-16) || !(t <= 4.9e+69)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.45e-16) || ~((t <= 4.9e+69))) tmp = y + x; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.45e-16], N[Not[LessEqual[t, 4.9e+69]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{-16} \lor \neg \left(t \leq 4.9 \cdot 10^{+69}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -1.4499999999999999e-16 or 4.9e69 < t Initial program 68.8%
Taylor expanded in t around inf 83.3%
+-commutative83.3%
Simplified83.3%
if -1.4499999999999999e-16 < t < 4.9e69Initial program 92.5%
Taylor expanded in t around 0 77.5%
Final simplification80.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.8e-16) (not (<= t 6.5e+69))) (+ y x) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.8e-16) || !(t <= 6.5e+69)) {
tmp = y + x;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.8d-16)) .or. (.not. (t <= 6.5d+69))) then
tmp = y + x
else
tmp = x + (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.8e-16) || !(t <= 6.5e+69)) {
tmp = y + x;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.8e-16) or not (t <= 6.5e+69): tmp = y + x else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.8e-16) || !(t <= 6.5e+69)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.8e-16) || ~((t <= 6.5e+69))) tmp = y + x; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.8e-16], N[Not[LessEqual[t, 6.5e+69]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-16} \lor \neg \left(t \leq 6.5 \cdot 10^{+69}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -1.79999999999999991e-16 or 6.5000000000000001e69 < t Initial program 68.8%
Taylor expanded in t around inf 83.3%
+-commutative83.3%
Simplified83.3%
if -1.79999999999999991e-16 < t < 6.5000000000000001e69Initial program 92.5%
+-commutative92.5%
associate-*l/98.6%
fma-def98.6%
Simplified98.6%
fma-udef98.6%
associate-*l/92.5%
associate-/l*94.5%
div-inv93.9%
clear-num94.5%
Applied egg-rr94.5%
Taylor expanded in t around 0 77.5%
associate-*r/81.7%
Simplified81.7%
Final simplification82.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.7e-16) (+ y x) (if (<= t 5.6e+69) (+ x (* z (/ y a))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.7e-16) {
tmp = y + x;
} else if (t <= 5.6e+69) {
tmp = x + (z * (y / 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 (t <= (-1.7d-16)) then
tmp = y + x
else if (t <= 5.6d+69) then
tmp = x + (z * (y / 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 (t <= -1.7e-16) {
tmp = y + x;
} else if (t <= 5.6e+69) {
tmp = x + (z * (y / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.7e-16: tmp = y + x elif t <= 5.6e+69: tmp = x + (z * (y / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.7e-16) tmp = Float64(y + x); elseif (t <= 5.6e+69) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.7e-16) tmp = y + x; elseif (t <= 5.6e+69) tmp = x + (z * (y / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.7e-16], N[(y + x), $MachinePrecision], If[LessEqual[t, 5.6e+69], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{-16}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{+69}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.7e-16 or 5.59999999999999964e69 < t Initial program 68.8%
Taylor expanded in t around inf 83.3%
+-commutative83.3%
Simplified83.3%
if -1.7e-16 < t < 5.59999999999999964e69Initial program 92.5%
Taylor expanded in t around 0 77.5%
+-commutative77.5%
associate-/l*81.7%
Simplified81.7%
associate-/r/83.5%
Applied egg-rr83.5%
Final simplification83.4%
(FPCore (x y z t a) :precision binary64 (+ x (/ (- z t) (/ (- a t) y))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / ((a - t) / y));
}
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 + ((z - t) / ((a - t) / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / ((a - t) / y));
}
def code(x, y, z, t, a): return x + ((z - t) / ((a - t) / y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) / Float64(Float64(a - t) / y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) / ((a - t) / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{\frac{a - t}{y}}
\end{array}
Initial program 82.1%
*-commutative82.1%
associate-/l*98.4%
Simplified98.4%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.4e+149) x (if (<= a 1.6e+71) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.4e+149) {
tmp = x;
} else if (a <= 1.6e+71) {
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 <= (-1.4d+149)) then
tmp = x
else if (a <= 1.6d+71) 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 <= -1.4e+149) {
tmp = x;
} else if (a <= 1.6e+71) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.4e+149: tmp = x elif a <= 1.6e+71: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.4e+149) tmp = x; elseif (a <= 1.6e+71) 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 <= -1.4e+149) tmp = x; elseif (a <= 1.6e+71) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.4e+149], x, If[LessEqual[a, 1.6e+71], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.4 \cdot 10^{+149}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+71}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.4e149 or 1.60000000000000012e71 < a Initial program 78.1%
Taylor expanded in x around inf 66.0%
if -1.4e149 < a < 1.60000000000000012e71Initial program 84.3%
Taylor expanded in t around inf 70.3%
+-commutative70.3%
Simplified70.3%
Final simplification68.8%
(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 82.1%
Taylor expanded in x around inf 53.8%
Final simplification53.8%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2023291
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))