
(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
(let* ((t_1 (/ (* (- z t) y) (- a t))))
(if (<= t_1 (- INFINITY))
(+ x (/ (- z t) (/ (- a t) y)))
(if (<= t_1 4e+307) (+ x t_1) (+ x (* (- z t) (/ y (- a t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) * y) / (a - t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + ((z - t) / ((a - t) / y));
} else if (t_1 <= 4e+307) {
tmp = x + t_1;
} else {
tmp = x + ((z - t) * (y / (a - t)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) * y) / (a - t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + ((z - t) / ((a - t) / y));
} else if (t_1 <= 4e+307) {
tmp = x + t_1;
} else {
tmp = x + ((z - t) * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - t) * y) / (a - t) tmp = 0 if t_1 <= -math.inf: tmp = x + ((z - t) / ((a - t) / y)) elif t_1 <= 4e+307: tmp = x + t_1 else: tmp = x + ((z - t) * (y / (a - t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) * y) / Float64(a - t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(a - t) / y))); elseif (t_1 <= 4e+307) tmp = Float64(x + t_1); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - t) * y) / (a - t); tmp = 0.0; if (t_1 <= -Inf) tmp = x + ((z - t) / ((a - t) / y)); elseif (t_1 <= 4e+307) tmp = x + t_1; else tmp = x + ((z - t) * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+307], N[(x + t$95$1), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;x + \frac{z - t}{\frac{a - t}{y}}\\
\mathbf{elif}\;t_1 \leq 4 \cdot 10^{+307}:\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0Initial program 46.0%
*-commutative46.0%
associate-/l*99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 3.99999999999999994e307Initial program 99.2%
if 3.99999999999999994e307 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 41.7%
associate-*l/99.8%
Applied egg-rr99.8%
Final simplification99.4%
(FPCore (x y z t a) :precision binary64 (fma (/ (- z t) (- a t)) y x))
double code(double x, double y, double z, double t, double a) {
return fma(((z - t) / (a - t)), y, x);
}
function code(x, y, z, t, a) return fma(Float64(Float64(z - t) / Float64(a - t)), y, x) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{z - t}{a - t}, y, x\right)
\end{array}
Initial program 84.8%
+-commutative84.8%
*-commutative84.8%
associate-*l/98.0%
fma-def98.0%
Simplified98.0%
Final simplification98.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- z t) y) (- a t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 4e+307)))
(+ x (* (- z t) (/ y (- a t))))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) * y) / (a - t);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 4e+307)) {
tmp = x + ((z - t) * (y / (a - t)));
} else {
tmp = x + t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((z - t) * y) / (a - t);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 4e+307)) {
tmp = x + ((z - t) * (y / (a - t)));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((z - t) * y) / (a - t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 4e+307): tmp = x + ((z - t) * (y / (a - t))) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(z - t) * y) / Float64(a - t)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 4e+307)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((z - t) * y) / (a - t); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 4e+307))) tmp = x + ((z - t) * (y / (a - t))); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 4e+307]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z - t\right) \cdot y}{a - t}\\
\mathbf{if}\;t_1 \leq -\infty \lor \neg \left(t_1 \leq 4 \cdot 10^{+307}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + t_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0 or 3.99999999999999994e307 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) Initial program 43.2%
associate-*l/99.8%
Applied egg-rr99.8%
if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 3.99999999999999994e307Initial program 99.2%
Final simplification99.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.25e-57) (not (<= t 8.8e-10))) (+ x (* y (- 1.0 (/ z t)))) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.25e-57) || !(t <= 8.8e-10)) {
tmp = x + (y * (1.0 - (z / t)));
} 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 <= (-2.25d-57)) .or. (.not. (t <= 8.8d-10))) then
tmp = x + (y * (1.0d0 - (z / t)))
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 <= -2.25e-57) || !(t <= 8.8e-10)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.25e-57) or not (t <= 8.8e-10): tmp = x + (y * (1.0 - (z / t))) else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.25e-57) || !(t <= 8.8e-10)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); 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 <= -2.25e-57) || ~((t <= 8.8e-10))) tmp = x + (y * (1.0 - (z / t))); else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.25e-57], N[Not[LessEqual[t, 8.8e-10]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.25 \cdot 10^{-57} \lor \neg \left(t \leq 8.8 \cdot 10^{-10}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -2.24999999999999986e-57 or 8.7999999999999996e-10 < t Initial program 75.8%
*-commutative75.8%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in a around 0 84.4%
neg-mul-184.4%
distribute-neg-frac84.4%
Simplified84.4%
Taylor expanded in z around 0 81.3%
mul-1-neg81.3%
unsub-neg81.3%
*-commutative81.3%
associate-*r/86.0%
Simplified86.0%
Taylor expanded in y around 0 86.6%
if -2.24999999999999986e-57 < t < 8.7999999999999996e-10Initial program 96.2%
+-commutative96.2%
associate-*l/95.8%
fma-def95.8%
Simplified95.8%
Taylor expanded in t around 0 75.8%
+-commutative75.8%
associate-/l*77.7%
Simplified77.7%
clear-num77.7%
associate-/r/77.6%
clear-num77.7%
Applied egg-rr77.7%
Final simplification82.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.3e-46) (not (<= t 15500.0))) (+ x (* y (- 1.0 (/ z t)))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.3e-46) || !(t <= 15500.0)) {
tmp = x + (y * (1.0 - (z / 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 <= (-2.3d-46)) .or. (.not. (t <= 15500.0d0))) then
tmp = x + (y * (1.0d0 - (z / 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 <= -2.3e-46) || !(t <= 15500.0)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.3e-46) or not (t <= 15500.0): tmp = x + (y * (1.0 - (z / t))) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.3e-46) || !(t <= 15500.0)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / 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 <= -2.3e-46) || ~((t <= 15500.0))) tmp = x + (y * (1.0 - (z / t))); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.3e-46], N[Not[LessEqual[t, 15500.0]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(z / 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 -2.3 \cdot 10^{-46} \lor \neg \left(t \leq 15500\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -2.2999999999999999e-46 or 15500 < t Initial program 75.1%
*-commutative75.1%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in a around 0 84.6%
neg-mul-184.6%
distribute-neg-frac84.6%
Simplified84.6%
Taylor expanded in z around 0 81.4%
mul-1-neg81.4%
unsub-neg81.4%
*-commutative81.4%
associate-*r/86.3%
Simplified86.3%
Taylor expanded in y around 0 86.9%
if -2.2999999999999999e-46 < t < 15500Initial program 96.3%
clear-num96.3%
inv-pow96.3%
Applied egg-rr96.3%
unpow-196.3%
associate-/r*96.4%
Simplified96.4%
Taylor expanded in z around inf 84.9%
associate-/l*86.0%
Simplified86.0%
Final simplification86.5%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.45e-49)
(+ x (* y (- 1.0 (/ z t))))
(if (<= t 5200000000.0)
(+ x (/ y (/ (- a t) z)))
(- x (/ t (/ (- a t) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.45e-49) {
tmp = x + (y * (1.0 - (z / t)));
} else if (t <= 5200000000.0) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x - (t / ((a - t) / 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.45d-49)) then
tmp = x + (y * (1.0d0 - (z / t)))
else if (t <= 5200000000.0d0) then
tmp = x + (y / ((a - t) / z))
else
tmp = x - (t / ((a - t) / 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.45e-49) {
tmp = x + (y * (1.0 - (z / t)));
} else if (t <= 5200000000.0) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x - (t / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.45e-49: tmp = x + (y * (1.0 - (z / t))) elif t <= 5200000000.0: tmp = x + (y / ((a - t) / z)) else: tmp = x - (t / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.45e-49) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); elseif (t <= 5200000000.0) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x - Float64(t / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.45e-49) tmp = x + (y * (1.0 - (z / t))); elseif (t <= 5200000000.0) tmp = x + (y / ((a - t) / z)); else tmp = x - (t / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.45e-49], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5200000000.0], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.45 \cdot 10^{-49}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{elif}\;t \leq 5200000000:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if t < -2.4500000000000001e-49Initial program 79.5%
*-commutative79.5%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in a around 0 86.6%
neg-mul-186.6%
distribute-neg-frac86.6%
Simplified86.6%
Taylor expanded in z around 0 82.9%
mul-1-neg82.9%
unsub-neg82.9%
*-commutative82.9%
associate-*r/87.2%
Simplified87.2%
Taylor expanded in y around 0 88.4%
if -2.4500000000000001e-49 < t < 5.2e9Initial program 96.4%
clear-num96.4%
inv-pow96.4%
Applied egg-rr96.4%
unpow-196.4%
associate-/r*96.4%
Simplified96.4%
Taylor expanded in z around inf 85.2%
associate-/l*86.2%
Simplified86.2%
if 5.2e9 < t Initial program 70.0%
+-commutative70.0%
associate-*l/95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in z around 0 64.0%
associate-*r/85.7%
neg-mul-185.7%
unsub-neg85.7%
associate-*r/64.0%
associate-/l*85.7%
Simplified85.7%
Final simplification86.7%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.6e-49)
(- x (/ y (/ t (- z t))))
(if (<= t 3000000000.0)
(+ x (/ y (/ (- a t) z)))
(- x (/ t (/ (- a t) y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.6e-49) {
tmp = x - (y / (t / (z - t)));
} else if (t <= 3000000000.0) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x - (t / ((a - t) / 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.6d-49)) then
tmp = x - (y / (t / (z - t)))
else if (t <= 3000000000.0d0) then
tmp = x + (y / ((a - t) / z))
else
tmp = x - (t / ((a - t) / 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.6e-49) {
tmp = x - (y / (t / (z - t)));
} else if (t <= 3000000000.0) {
tmp = x + (y / ((a - t) / z));
} else {
tmp = x - (t / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.6e-49: tmp = x - (y / (t / (z - t))) elif t <= 3000000000.0: tmp = x + (y / ((a - t) / z)) else: tmp = x - (t / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.6e-49) tmp = Float64(x - Float64(y / Float64(t / Float64(z - t)))); elseif (t <= 3000000000.0) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); else tmp = Float64(x - Float64(t / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.6e-49) tmp = x - (y / (t / (z - t))); elseif (t <= 3000000000.0) tmp = x + (y / ((a - t) / z)); else tmp = x - (t / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.6e-49], N[(x - N[(y / N[(t / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3000000000.0], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.6 \cdot 10^{-49}:\\
\;\;\;\;x - \frac{y}{\frac{t}{z - t}}\\
\mathbf{elif}\;t \leq 3000000000:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if t < -2.59999999999999995e-49Initial program 79.5%
+-commutative79.5%
associate-*l/96.3%
fma-def96.3%
Simplified96.3%
Taylor expanded in a around 0 72.1%
mul-1-neg72.1%
unsub-neg72.1%
associate-/l*88.5%
Simplified88.5%
if -2.59999999999999995e-49 < t < 3e9Initial program 96.4%
clear-num96.4%
inv-pow96.4%
Applied egg-rr96.4%
unpow-196.4%
associate-/r*96.4%
Simplified96.4%
Taylor expanded in z around inf 85.2%
associate-/l*86.2%
Simplified86.2%
if 3e9 < t Initial program 70.0%
+-commutative70.0%
associate-*l/95.7%
fma-def95.7%
Simplified95.7%
Taylor expanded in z around 0 64.0%
associate-*r/85.7%
neg-mul-185.7%
unsub-neg85.7%
associate-*r/64.0%
associate-/l*85.7%
Simplified85.7%
Final simplification86.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.7e-47) (+ y x) (if (<= t 3e-8) (+ x (/ z (/ a y))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.7e-47) {
tmp = y + x;
} else if (t <= 3e-8) {
tmp = x + (z / (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 <= (-3.7d-47)) then
tmp = y + x
else if (t <= 3d-8) then
tmp = x + (z / (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 <= -3.7e-47) {
tmp = y + x;
} else if (t <= 3e-8) {
tmp = x + (z / (a / y));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.7e-47: tmp = y + x elif t <= 3e-8: tmp = x + (z / (a / y)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.7e-47) tmp = Float64(y + x); elseif (t <= 3e-8) tmp = Float64(x + Float64(z / 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 <= -3.7e-47) tmp = y + x; elseif (t <= 3e-8) tmp = x + (z / (a / y)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.7e-47], N[(y + x), $MachinePrecision], If[LessEqual[t, 3e-8], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{-47}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-8}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -3.7e-47 or 2.99999999999999973e-8 < t Initial program 75.8%
+-commutative75.8%
associate-*l/96.2%
fma-def96.2%
Simplified96.2%
Taylor expanded in t around inf 78.1%
+-commutative78.1%
Simplified78.1%
if -3.7e-47 < t < 2.99999999999999973e-8Initial program 96.2%
clear-num96.2%
inv-pow96.2%
Applied egg-rr96.2%
unpow-196.2%
associate-/r*96.2%
Simplified96.2%
Taylor expanded in t around 0 75.8%
*-commutative75.8%
associate-/l*77.4%
Simplified77.4%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.8e-47) (+ y x) (if (<= t 3.4e-11) (+ x (* y (/ z a))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.8e-47) {
tmp = y + x;
} else if (t <= 3.4e-11) {
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 (t <= (-3.8d-47)) then
tmp = y + x
else if (t <= 3.4d-11) 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 (t <= -3.8e-47) {
tmp = y + x;
} else if (t <= 3.4e-11) {
tmp = x + (y * (z / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.8e-47: tmp = y + x elif t <= 3.4e-11: tmp = x + (y * (z / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.8e-47) tmp = Float64(y + x); elseif (t <= 3.4e-11) 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 (t <= -3.8e-47) tmp = y + x; elseif (t <= 3.4e-11) tmp = x + (y * (z / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.8e-47], N[(y + x), $MachinePrecision], If[LessEqual[t, 3.4e-11], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{-47}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{-11}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -3.80000000000000015e-47 or 3.3999999999999999e-11 < t Initial program 75.8%
+-commutative75.8%
associate-*l/96.2%
fma-def96.2%
Simplified96.2%
Taylor expanded in t around inf 78.1%
+-commutative78.1%
Simplified78.1%
if -3.80000000000000015e-47 < t < 3.3999999999999999e-11Initial program 96.2%
+-commutative96.2%
associate-*l/95.8%
fma-def95.8%
Simplified95.8%
Taylor expanded in t around 0 75.8%
+-commutative75.8%
associate-/l*77.7%
Simplified77.7%
clear-num77.7%
associate-/r/77.6%
clear-num77.7%
Applied egg-rr77.7%
Final simplification77.9%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (a - t)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a - t}
\end{array}
Initial program 84.8%
associate-*l/96.0%
Applied egg-rr96.0%
Final simplification96.0%
(FPCore (x y z t a) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a) {
return y + 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 = y + x
end function
public static double code(double x, double y, double z, double t, double a) {
return y + x;
}
def code(x, y, z, t, a): return y + x
function code(x, y, z, t, a) return Float64(y + x) end
function tmp = code(x, y, z, t, a) tmp = y + x; end
code[x_, y_, z_, t_, a_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 84.8%
+-commutative84.8%
associate-*l/96.0%
fma-def96.0%
Simplified96.0%
Taylor expanded in t around inf 59.6%
+-commutative59.6%
Simplified59.6%
Final simplification59.6%
(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 84.8%
+-commutative84.8%
associate-*l/96.0%
fma-def96.0%
Simplified96.0%
Taylor expanded in y around 0 46.5%
Final simplification46.5%
(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 2023275
(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))))