
(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 10 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 85.2%
+-commutative85.2%
associate-/l*98.8%
fma-define98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ z a)))))
(if (<= t -6.5e-28)
(+ y x)
(if (<= t 1.6e-11)
t_1
(if (<= t 1.95e+51)
(- x (* y (/ z t)))
(if (<= t 9.8e+119) t_1 (+ y x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * (z / a));
double tmp;
if (t <= -6.5e-28) {
tmp = y + x;
} else if (t <= 1.6e-11) {
tmp = t_1;
} else if (t <= 1.95e+51) {
tmp = x - (y * (z / t));
} else if (t <= 9.8e+119) {
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 * (z / a))
if (t <= (-6.5d-28)) then
tmp = y + x
else if (t <= 1.6d-11) then
tmp = t_1
else if (t <= 1.95d+51) then
tmp = x - (y * (z / t))
else if (t <= 9.8d+119) 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 * (z / a));
double tmp;
if (t <= -6.5e-28) {
tmp = y + x;
} else if (t <= 1.6e-11) {
tmp = t_1;
} else if (t <= 1.95e+51) {
tmp = x - (y * (z / t));
} else if (t <= 9.8e+119) {
tmp = t_1;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * (z / a)) tmp = 0 if t <= -6.5e-28: tmp = y + x elif t <= 1.6e-11: tmp = t_1 elif t <= 1.95e+51: tmp = x - (y * (z / t)) elif t <= 9.8e+119: tmp = t_1 else: tmp = y + x return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(z / a))) tmp = 0.0 if (t <= -6.5e-28) tmp = Float64(y + x); elseif (t <= 1.6e-11) tmp = t_1; elseif (t <= 1.95e+51) tmp = Float64(x - Float64(y * Float64(z / t))); elseif (t <= 9.8e+119) 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 * (z / a)); tmp = 0.0; if (t <= -6.5e-28) tmp = y + x; elseif (t <= 1.6e-11) tmp = t_1; elseif (t <= 1.95e+51) tmp = x - (y * (z / t)); elseif (t <= 9.8e+119) 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[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.5e-28], N[(y + x), $MachinePrecision], If[LessEqual[t, 1.6e-11], t$95$1, If[LessEqual[t, 1.95e+51], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.8e+119], t$95$1, N[(y + x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{a}\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{-28}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+51}:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{+119}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -6.50000000000000043e-28 or 9.79999999999999992e119 < t Initial program 72.1%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 81.7%
+-commutative81.7%
Simplified81.7%
if -6.50000000000000043e-28 < t < 1.59999999999999997e-11 or 1.94999999999999992e51 < t < 9.79999999999999992e119Initial program 93.7%
associate-/l*97.9%
Simplified97.9%
Taylor expanded in t around 0 75.6%
+-commutative75.6%
associate-/l*80.4%
Simplified80.4%
if 1.59999999999999997e-11 < t < 1.94999999999999992e51Initial program 94.1%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around inf 88.1%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in a around 0 88.1%
mul-1-neg88.1%
associate-*r/94.0%
unsub-neg94.0%
Simplified94.0%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e+93) (not (<= t 1.4e+186))) (+ y x) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e+93) || !(t <= 1.4e+186)) {
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 <= (-2.2d+93)) .or. (.not. (t <= 1.4d+186))) 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 <= -2.2e+93) || !(t <= 1.4e+186)) {
tmp = y + x;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e+93) or not (t <= 1.4e+186): tmp = y + x else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e+93) || !(t <= 1.4e+186)) 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 <= -2.2e+93) || ~((t <= 1.4e+186))) 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, -2.2e+93], N[Not[LessEqual[t, 1.4e+186]], $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 -2.2 \cdot 10^{+93} \lor \neg \left(t \leq 1.4 \cdot 10^{+186}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -2.20000000000000021e93 or 1.40000000000000009e186 < t Initial program 66.6%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 88.5%
+-commutative88.5%
Simplified88.5%
if -2.20000000000000021e93 < t < 1.40000000000000009e186Initial program 91.1%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in z around inf 80.5%
associate-/l*85.9%
Simplified85.9%
Final simplification86.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.5e-25) (not (<= t 1.5e+186))) (- x (* y (+ (/ z t) -1.0))) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.5e-25) || !(t <= 1.5e+186)) {
tmp = x - (y * ((z / t) + -1.0));
} 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 <= (-5.5d-25)) .or. (.not. (t <= 1.5d+186))) then
tmp = x - (y * ((z / t) + (-1.0d0)))
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 <= -5.5e-25) || !(t <= 1.5e+186)) {
tmp = x - (y * ((z / t) + -1.0));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.5e-25) or not (t <= 1.5e+186): tmp = x - (y * ((z / t) + -1.0)) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.5e-25) || !(t <= 1.5e+186)) tmp = Float64(x - Float64(y * Float64(Float64(z / t) + -1.0))); 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 <= -5.5e-25) || ~((t <= 1.5e+186))) tmp = x - (y * ((z / t) + -1.0)); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.5e-25], N[Not[LessEqual[t, 1.5e+186]], $MachinePrecision]], N[(x - N[(y * N[(N[(z / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-25} \lor \neg \left(t \leq 1.5 \cdot 10^{+186}\right):\\
\;\;\;\;x - y \cdot \left(\frac{z}{t} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -5.50000000000000004e-25 or 1.49999999999999991e186 < t Initial program 72.6%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in a around 0 67.6%
mul-1-neg67.6%
unsub-neg67.6%
associate-/l*90.5%
div-sub90.5%
sub-neg90.5%
*-inverses90.5%
metadata-eval90.5%
Simplified90.5%
if -5.50000000000000004e-25 < t < 1.49999999999999991e186Initial program 91.9%
associate-/l*98.2%
Simplified98.2%
Taylor expanded in z around inf 82.4%
associate-/l*87.0%
Simplified87.0%
Final simplification88.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -0.052) (- x (* z (/ y (- t a)))) (if (<= z 1.5e+112) (+ x (* y (/ t (- t a)))) (+ x (* y (/ z (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.052) {
tmp = x - (z * (y / (t - a)));
} else if (z <= 1.5e+112) {
tmp = x + (y * (t / (t - a)));
} 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 (z <= (-0.052d0)) then
tmp = x - (z * (y / (t - a)))
else if (z <= 1.5d+112) then
tmp = x + (y * (t / (t - a)))
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 (z <= -0.052) {
tmp = x - (z * (y / (t - a)));
} else if (z <= 1.5e+112) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -0.052: tmp = x - (z * (y / (t - a))) elif z <= 1.5e+112: tmp = x + (y * (t / (t - a))) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -0.052) tmp = Float64(x - Float64(z * Float64(y / Float64(t - a)))); elseif (z <= 1.5e+112) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); 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 (z <= -0.052) tmp = x - (z * (y / (t - a))); elseif (z <= 1.5e+112) tmp = x + (y * (t / (t - a))); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -0.052], N[(x - N[(z * N[(y / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+112], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.052:\\
\;\;\;\;x - z \cdot \frac{y}{t - a}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+112}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if z < -0.0519999999999999976Initial program 83.3%
*-commutative83.3%
associate-/l*99.5%
Applied egg-rr99.5%
Taylor expanded in z around inf 81.2%
associate-*l/94.7%
*-commutative94.7%
Simplified94.7%
if -0.0519999999999999976 < z < 1.4999999999999999e112Initial program 88.2%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in z around 0 80.6%
mul-1-neg80.6%
unsub-neg80.6%
*-commutative80.6%
associate-/l*92.3%
Simplified92.3%
if 1.4999999999999999e112 < z Initial program 76.9%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around inf 76.7%
associate-/l*90.6%
Simplified90.6%
Final simplification92.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9.5e-27) (not (<= t 4.5e+87))) (+ y x) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.5e-27) || !(t <= 4.5e+87)) {
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 <= (-9.5d-27)) .or. (.not. (t <= 4.5d+87))) 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 <= -9.5e-27) || !(t <= 4.5e+87)) {
tmp = y + x;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9.5e-27) or not (t <= 4.5e+87): tmp = y + x else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9.5e-27) || !(t <= 4.5e+87)) 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 <= -9.5e-27) || ~((t <= 4.5e+87))) tmp = y + x; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9.5e-27], N[Not[LessEqual[t, 4.5e+87]], $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 -9.5 \cdot 10^{-27} \lor \neg \left(t \leq 4.5 \cdot 10^{+87}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -9.50000000000000037e-27 or 4.5000000000000003e87 < t Initial program 71.8%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 78.8%
+-commutative78.8%
Simplified78.8%
if -9.50000000000000037e-27 < t < 4.5000000000000003e87Initial program 95.3%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in t around 0 76.8%
*-commutative76.8%
associate-/l*78.2%
Applied egg-rr78.2%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.5e-25) (not (<= t 6.6e+119))) (+ y x) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.5e-25) || !(t <= 6.6e+119)) {
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 <= (-5.5d-25)) .or. (.not. (t <= 6.6d+119))) 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 <= -5.5e-25) || !(t <= 6.6e+119)) {
tmp = y + x;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.5e-25) or not (t <= 6.6e+119): tmp = y + x else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.5e-25) || !(t <= 6.6e+119)) 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 <= -5.5e-25) || ~((t <= 6.6e+119))) tmp = y + x; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.5e-25], N[Not[LessEqual[t, 6.6e+119]], $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 -5.5 \cdot 10^{-25} \lor \neg \left(t \leq 6.6 \cdot 10^{+119}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -5.50000000000000004e-25 or 6.6000000000000004e119 < t Initial program 72.1%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in t around inf 81.7%
+-commutative81.7%
Simplified81.7%
if -5.50000000000000004e-25 < t < 6.6000000000000004e119Initial program 93.7%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in t around 0 74.4%
+-commutative74.4%
associate-/l*78.7%
Simplified78.7%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.8e+155) x (if (<= a 1.25e+191) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.8e+155) {
tmp = x;
} else if (a <= 1.25e+191) {
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 <= (-6.8d+155)) then
tmp = x
else if (a <= 1.25d+191) 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 <= -6.8e+155) {
tmp = x;
} else if (a <= 1.25e+191) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.8e+155: tmp = x elif a <= 1.25e+191: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.8e+155) tmp = x; elseif (a <= 1.25e+191) 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 <= -6.8e+155) tmp = x; elseif (a <= 1.25e+191) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.8e+155], x, If[LessEqual[a, 1.25e+191], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{+155}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+191}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -6.8000000000000002e155 or 1.25000000000000005e191 < a Initial program 78.1%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in x around inf 67.1%
if -6.8000000000000002e155 < a < 1.25000000000000005e191Initial program 87.4%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in t around inf 66.5%
+-commutative66.5%
Simplified66.5%
Final simplification66.6%
(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}
Initial program 85.2%
associate-/l*98.8%
Simplified98.8%
Final simplification98.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 85.2%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in x around inf 56.0%
Final simplification56.0%
(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 2024059
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))