
(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 (/ (- z t) (- a t)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (a - t)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(a - t)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{a - t}, x\right)
\end{array}
Initial program 81.2%
+-commutative81.2%
associate-*r/99.0%
fma-def99.0%
Simplified99.0%
Final simplification99.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.5e+79)
(+ y x)
(if (<= t -4.5e-62)
(- x (* y (/ z t)))
(if (<= t 2.95) (+ x (/ y (/ a z))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.5e+79) {
tmp = y + x;
} else if (t <= -4.5e-62) {
tmp = x - (y * (z / t));
} else if (t <= 2.95) {
tmp = x + (y / (a / z));
} 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 <= (-5.5d+79)) then
tmp = y + x
else if (t <= (-4.5d-62)) then
tmp = x - (y * (z / t))
else if (t <= 2.95d0) then
tmp = x + (y / (a / z))
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 <= -5.5e+79) {
tmp = y + x;
} else if (t <= -4.5e-62) {
tmp = x - (y * (z / t));
} else if (t <= 2.95) {
tmp = x + (y / (a / z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.5e+79: tmp = y + x elif t <= -4.5e-62: tmp = x - (y * (z / t)) elif t <= 2.95: tmp = x + (y / (a / z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.5e+79) tmp = Float64(y + x); elseif (t <= -4.5e-62) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= 2.95) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.5e+79) tmp = y + x; elseif (t <= -4.5e-62) tmp = x - (y * (z / t)); elseif (t <= 2.95) tmp = x + (y / (a / z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.5e+79], N[(y + x), $MachinePrecision], If[LessEqual[t, -4.5e-62], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.95], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{+79}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{-62}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 2.95:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -5.50000000000000007e79 or 2.9500000000000002 < t Initial program 68.3%
associate-*l/94.6%
Simplified94.6%
Taylor expanded in t around inf 78.0%
if -5.50000000000000007e79 < t < -4.50000000000000018e-62Initial program 94.0%
associate-/l*99.8%
Simplified99.8%
clear-num99.7%
associate-/r/99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 74.4%
Taylor expanded in a around 0 62.2%
+-commutative62.2%
mul-1-neg62.2%
associate-*l/65.1%
*-commutative65.1%
distribute-lft-neg-in65.1%
cancel-sign-sub-inv65.1%
associate-*r/62.2%
associate-*l/65.0%
*-commutative65.0%
Simplified65.0%
if -4.50000000000000018e-62 < t < 2.9500000000000002Initial program 91.2%
associate-*l/93.1%
Simplified93.1%
Taylor expanded in t around 0 73.9%
associate-/l*81.8%
Simplified81.8%
Final simplification78.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.2e+80)
(+ y x)
(if (<= t -1.3e-60)
(- x (* z (/ y t)))
(if (<= t 7800.0) (+ x (/ y (/ a z))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.2e+80) {
tmp = y + x;
} else if (t <= -1.3e-60) {
tmp = x - (z * (y / t));
} else if (t <= 7800.0) {
tmp = x + (y / (a / z));
} 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 <= (-2.2d+80)) then
tmp = y + x
else if (t <= (-1.3d-60)) then
tmp = x - (z * (y / t))
else if (t <= 7800.0d0) then
tmp = x + (y / (a / z))
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 <= -2.2e+80) {
tmp = y + x;
} else if (t <= -1.3e-60) {
tmp = x - (z * (y / t));
} else if (t <= 7800.0) {
tmp = x + (y / (a / z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.2e+80: tmp = y + x elif t <= -1.3e-60: tmp = x - (z * (y / t)) elif t <= 7800.0: tmp = x + (y / (a / z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.2e+80) tmp = Float64(y + x); elseif (t <= -1.3e-60) tmp = Float64(x - Float64(z * Float64(y / t))); elseif (t <= 7800.0) tmp = Float64(x + Float64(y / Float64(a / z))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.2e+80) tmp = y + x; elseif (t <= -1.3e-60) tmp = x - (z * (y / t)); elseif (t <= 7800.0) tmp = x + (y / (a / z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.2e+80], N[(y + x), $MachinePrecision], If[LessEqual[t, -1.3e-60], N[(x - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7800.0], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{+80}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{-60}:\\
\;\;\;\;x - z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 7800:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -2.20000000000000003e80 or 7800 < t Initial program 68.3%
associate-*l/94.6%
Simplified94.6%
Taylor expanded in t around inf 78.0%
if -2.20000000000000003e80 < t < -1.2999999999999999e-60Initial program 94.0%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in z around inf 71.6%
associate-*l/74.5%
*-commutative74.5%
Simplified74.5%
Taylor expanded in a around 0 62.2%
+-commutative62.2%
mul-1-neg62.2%
unsub-neg62.2%
associate-/l*65.0%
Simplified65.0%
associate-/r/65.1%
Applied egg-rr65.1%
if -1.2999999999999999e-60 < t < 7800Initial program 91.2%
associate-*l/93.1%
Simplified93.1%
Taylor expanded in t around 0 73.9%
associate-/l*81.8%
Simplified81.8%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.05e+143) (not (<= t 2.25e+104))) (+ y x) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.05e+143) || !(t <= 2.25e+104)) {
tmp = y + x;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3.05d+143)) .or. (.not. (t <= 2.25d+104))) then
tmp = y + x
else
tmp = x + (z * (y / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.05e+143) || !(t <= 2.25e+104)) {
tmp = y + x;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.05e+143) or not (t <= 2.25e+104): tmp = y + x else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.05e+143) || !(t <= 2.25e+104)) tmp = Float64(y + x); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.05e+143) || ~((t <= 2.25e+104))) tmp = y + x; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.05e+143], N[Not[LessEqual[t, 2.25e+104]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.05 \cdot 10^{+143} \lor \neg \left(t \leq 2.25 \cdot 10^{+104}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -3.0500000000000002e143 or 2.2499999999999999e104 < t Initial program 59.7%
associate-*l/93.7%
Simplified93.7%
Taylor expanded in t around inf 82.8%
if -3.0500000000000002e143 < t < 2.2499999999999999e104Initial program 91.7%
associate-*l/95.0%
Simplified95.0%
Taylor expanded in z around inf 81.1%
associate-*l/85.5%
*-commutative85.5%
Simplified85.5%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.5e+144) (not (<= t 2.25e+104))) (+ y x) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.5e+144) || !(t <= 2.25e+104)) {
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 <= (-1.5d+144)) .or. (.not. (t <= 2.25d+104))) 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 <= -1.5e+144) || !(t <= 2.25e+104)) {
tmp = y + x;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.5e+144) or not (t <= 2.25e+104): tmp = y + x else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.5e+144) || !(t <= 2.25e+104)) 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 <= -1.5e+144) || ~((t <= 2.25e+104))) 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, -1.5e+144], N[Not[LessEqual[t, 2.25e+104]], $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 -1.5 \cdot 10^{+144} \lor \neg \left(t \leq 2.25 \cdot 10^{+104}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -1.49999999999999995e144 or 2.2499999999999999e104 < t Initial program 59.7%
associate-*l/93.7%
Simplified93.7%
Taylor expanded in t around inf 82.8%
if -1.49999999999999995e144 < t < 2.2499999999999999e104Initial program 91.7%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in z around inf 87.1%
Final simplification85.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.35e-38) (+ x (* z (/ y (- a t)))) (if (<= z 1.2e+28) (- x (/ y (+ (/ a t) -1.0))) (+ x (/ y (/ (- a t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.35e-38) {
tmp = x + (z * (y / (a - t)));
} else if (z <= 1.2e+28) {
tmp = x - (y / ((a / t) + -1.0));
} 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.35d-38)) then
tmp = x + (z * (y / (a - t)))
else if (z <= 1.2d+28) then
tmp = x - (y / ((a / t) + (-1.0d0)))
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.35e-38) {
tmp = x + (z * (y / (a - t)));
} else if (z <= 1.2e+28) {
tmp = x - (y / ((a / t) + -1.0));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.35e-38: tmp = x + (z * (y / (a - t))) elif z <= 1.2e+28: tmp = x - (y / ((a / t) + -1.0)) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.35e-38) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); elseif (z <= 1.2e+28) tmp = Float64(x - Float64(y / Float64(Float64(a / t) + -1.0))); 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.35e-38) tmp = x + (z * (y / (a - t))); elseif (z <= 1.2e+28) tmp = x - (y / ((a / t) + -1.0)); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.35e-38], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+28], N[(x - N[(y / N[(N[(a / t), $MachinePrecision] + -1.0), $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.35 \cdot 10^{-38}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+28}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t} + -1}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if z < -3.3500000000000002e-38Initial program 84.1%
associate-*l/97.8%
Simplified97.8%
Taylor expanded in z around inf 79.0%
associate-*l/88.7%
*-commutative88.7%
Simplified88.7%
if -3.3500000000000002e-38 < z < 1.19999999999999991e28Initial program 80.4%
associate-*l/91.4%
Simplified91.4%
Taylor expanded in z around 0 71.0%
+-commutative71.0%
mul-1-neg71.0%
unsub-neg71.0%
associate-/l*89.3%
div-sub89.3%
sub-neg89.3%
*-inverses89.3%
metadata-eval89.3%
Simplified89.3%
if 1.19999999999999991e28 < z Initial program 78.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 93.6%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.42e-5) (not (<= t 88.0))) (+ y x) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.42e-5) || !(t <= 88.0)) {
tmp = y + x;
} else {
tmp = x + (z * (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.42d-5)) .or. (.not. (t <= 88.0d0))) then
tmp = y + x
else
tmp = x + (z * (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.42e-5) || !(t <= 88.0)) {
tmp = y + x;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.42e-5) or not (t <= 88.0): tmp = y + x else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.42e-5) || !(t <= 88.0)) tmp = Float64(y + x); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.42e-5) || ~((t <= 88.0))) tmp = y + x; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.42e-5], N[Not[LessEqual[t, 88.0]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.42 \cdot 10^{-5} \lor \neg \left(t \leq 88\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.42e-5 or 88 < t Initial program 70.5%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in t around inf 74.4%
if -1.42e-5 < t < 88Initial program 92.4%
associate-*l/93.9%
Simplified93.9%
Taylor expanded in t around 0 70.5%
associate-/l*77.4%
Simplified77.4%
associate-/r/76.5%
Applied egg-rr76.5%
Final simplification75.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.9e-6) (not (<= t 1920.0))) (+ y x) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.9e-6) || !(t <= 1920.0)) {
tmp = y + x;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.9d-6)) .or. (.not. (t <= 1920.0d0))) then
tmp = y + x
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.9e-6) || !(t <= 1920.0)) {
tmp = y + x;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.9e-6) or not (t <= 1920.0): tmp = y + x else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.9e-6) || !(t <= 1920.0)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.9e-6) || ~((t <= 1920.0))) tmp = y + x; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.9e-6], N[Not[LessEqual[t, 1920.0]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-6} \lor \neg \left(t \leq 1920\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -1.9e-6 or 1920 < t Initial program 70.5%
associate-*l/95.2%
Simplified95.2%
Taylor expanded in t around inf 74.4%
if -1.9e-6 < t < 1920Initial program 92.4%
associate-*l/93.9%
Simplified93.9%
Taylor expanded in t around 0 70.5%
associate-/l*77.4%
Simplified77.4%
Final simplification75.8%
(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 81.2%
associate-*l/94.6%
Simplified94.6%
Final simplification94.6%
(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}
Initial program 81.2%
associate-/l*99.0%
Simplified99.0%
Final simplification99.0%
(FPCore (x y z t a) :precision binary64 (if (<= a 3.6e+15) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 3.6e+15) {
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 <= 3.6d+15) 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 <= 3.6e+15) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 3.6e+15: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 3.6e+15) 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 <= 3.6e+15) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 3.6e+15], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.6 \cdot 10^{+15}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 3.6e15Initial program 80.4%
associate-*l/94.2%
Simplified94.2%
Taylor expanded in t around inf 60.4%
if 3.6e15 < a Initial program 83.9%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in x around inf 63.4%
Final simplification61.1%
(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 81.2%
associate-*l/94.6%
Simplified94.6%
Taylor expanded in x around inf 49.4%
Final simplification49.4%
(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 2023185
(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))))