
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
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 - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
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 - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ t (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (t / (a - z)));
}
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 - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * (t / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * (t / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * (t / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t}{a - z}
\end{array}
Initial program 85.6%
associate-/l*97.8%
Simplified97.8%
Final simplification97.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.2e+119)
(+ x t)
(if (<= z 2.8e+17)
(+ x (/ y (/ (- a z) t)))
(if (<= z 8.5e+49)
(- x (* t (/ (- z y) a)))
(if (<= z 9.2e+89) (- x (/ (* y t) z)) (+ x t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.2e+119) {
tmp = x + t;
} else if (z <= 2.8e+17) {
tmp = x + (y / ((a - z) / t));
} else if (z <= 8.5e+49) {
tmp = x - (t * ((z - y) / a));
} else if (z <= 9.2e+89) {
tmp = x - ((y * t) / z);
} else {
tmp = x + 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 <= (-1.2d+119)) then
tmp = x + t
else if (z <= 2.8d+17) then
tmp = x + (y / ((a - z) / t))
else if (z <= 8.5d+49) then
tmp = x - (t * ((z - y) / a))
else if (z <= 9.2d+89) then
tmp = x - ((y * t) / z)
else
tmp = x + 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 <= -1.2e+119) {
tmp = x + t;
} else if (z <= 2.8e+17) {
tmp = x + (y / ((a - z) / t));
} else if (z <= 8.5e+49) {
tmp = x - (t * ((z - y) / a));
} else if (z <= 9.2e+89) {
tmp = x - ((y * t) / z);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.2e+119: tmp = x + t elif z <= 2.8e+17: tmp = x + (y / ((a - z) / t)) elif z <= 8.5e+49: tmp = x - (t * ((z - y) / a)) elif z <= 9.2e+89: tmp = x - ((y * t) / z) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.2e+119) tmp = Float64(x + t); elseif (z <= 2.8e+17) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); elseif (z <= 8.5e+49) tmp = Float64(x - Float64(t * Float64(Float64(z - y) / a))); elseif (z <= 9.2e+89) tmp = Float64(x - Float64(Float64(y * t) / z)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.2e+119) tmp = x + t; elseif (z <= 2.8e+17) tmp = x + (y / ((a - z) / t)); elseif (z <= 8.5e+49) tmp = x - (t * ((z - y) / a)); elseif (z <= 9.2e+89) tmp = x - ((y * t) / z); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.2e+119], N[(x + t), $MachinePrecision], If[LessEqual[z, 2.8e+17], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+49], N[(x - N[(t * N[(N[(z - y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e+89], N[(x - N[(N[(y * t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+119}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+17}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+49}:\\
\;\;\;\;x - t \cdot \frac{z - y}{a}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+89}:\\
\;\;\;\;x - \frac{y \cdot t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.2e119 or 9.1999999999999996e89 < z Initial program 68.4%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in z around inf 90.3%
if -1.2e119 < z < 2.8e17Initial program 93.9%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in y around inf 85.3%
associate-*l/90.0%
*-commutative90.0%
Simplified90.0%
clear-num90.0%
un-div-inv90.1%
Applied egg-rr90.1%
if 2.8e17 < z < 8.4999999999999996e49Initial program 73.0%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in a around inf 69.9%
+-commutative69.9%
associate-/l*96.7%
Simplified96.7%
if 8.4999999999999996e49 < z < 9.1999999999999996e89Initial program 100.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in a around 0 88.3%
mul-1-neg88.3%
unsub-neg88.3%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in y around inf 87.7%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.5e+118) (not (<= z 1.15e+90))) (+ x t) (- x (* y (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.5e+118) || !(z <= 1.15e+90)) {
tmp = x + t;
} else {
tmp = x - (y * (t / (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 ((z <= (-8.5d+118)) .or. (.not. (z <= 1.15d+90))) then
tmp = x + t
else
tmp = x - (y * (t / (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 ((z <= -8.5e+118) || !(z <= 1.15e+90)) {
tmp = x + t;
} else {
tmp = x - (y * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.5e+118) or not (z <= 1.15e+90): tmp = x + t else: tmp = x - (y * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.5e+118) || !(z <= 1.15e+90)) tmp = Float64(x + t); else tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.5e+118) || ~((z <= 1.15e+90))) tmp = x + t; else tmp = x - (y * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.5e+118], N[Not[LessEqual[z, 1.15e+90]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+118} \lor \neg \left(z \leq 1.15 \cdot 10^{+90}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if z < -8.50000000000000033e118 or 1.15e90 < z Initial program 68.4%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in z around inf 90.3%
if -8.50000000000000033e118 < z < 1.15e90Initial program 93.4%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in y around inf 83.8%
associate-*l/87.9%
*-commutative87.9%
Simplified87.9%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.08e+95) (not (<= z 1200000000000.0))) (+ x (* t (/ z (- z a)))) (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.08e+95) || !(z <= 1200000000000.0)) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + (y / ((a - z) / 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 <= (-1.08d+95)) .or. (.not. (z <= 1200000000000.0d0))) then
tmp = x + (t * (z / (z - a)))
else
tmp = x + (y / ((a - z) / 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 <= -1.08e+95) || !(z <= 1200000000000.0)) {
tmp = x + (t * (z / (z - a)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.08e+95) or not (z <= 1200000000000.0): tmp = x + (t * (z / (z - a))) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.08e+95) || !(z <= 1200000000000.0)) tmp = Float64(x + Float64(t * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.08e+95) || ~((z <= 1200000000000.0))) tmp = x + (t * (z / (z - a))); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.08e+95], N[Not[LessEqual[z, 1200000000000.0]], $MachinePrecision]], N[(x + N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{+95} \lor \neg \left(z \leq 1200000000000\right):\\
\;\;\;\;x + t \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -1.0800000000000001e95 or 1.2e12 < z Initial program 72.5%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in y around 0 66.4%
mul-1-neg66.4%
unsub-neg66.4%
associate-/l*92.5%
Simplified92.5%
if -1.0800000000000001e95 < z < 1.2e12Initial program 94.8%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in y around inf 86.1%
associate-*l/90.5%
*-commutative90.5%
Simplified90.5%
clear-num90.6%
un-div-inv90.6%
Applied egg-rr90.6%
Final simplification91.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.72e+31) (not (<= z 1.05e+14))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.72e+31) || !(z <= 1.05e+14)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1.72d+31)) .or. (.not. (z <= 1.05d+14))) then
tmp = x + t
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.72e+31) || !(z <= 1.05e+14)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.72e+31) or not (z <= 1.05e+14): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.72e+31) || !(z <= 1.05e+14)) tmp = Float64(x + t); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.72e+31) || ~((z <= 1.05e+14))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.72e+31], N[Not[LessEqual[z, 1.05e+14]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.72 \cdot 10^{+31} \lor \neg \left(z \leq 1.05 \cdot 10^{+14}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.72e31 or 1.05e14 < z Initial program 76.5%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 80.0%
if -1.72e31 < z < 1.05e14Initial program 94.1%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in z around 0 75.7%
*-commutative75.7%
associate-/l*80.7%
Simplified80.7%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (if (<= y 2.2e+236) (+ x t) (* t (- 1.0 (/ y z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 2.2e+236) {
tmp = x + t;
} else {
tmp = t * (1.0 - (y / 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 (y <= 2.2d+236) then
tmp = x + t
else
tmp = t * (1.0d0 - (y / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 2.2e+236) {
tmp = x + t;
} else {
tmp = t * (1.0 - (y / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 2.2e+236: tmp = x + t else: tmp = t * (1.0 - (y / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 2.2e+236) tmp = Float64(x + t); else tmp = Float64(t * Float64(1.0 - Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 2.2e+236) tmp = x + t; else tmp = t * (1.0 - (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 2.2e+236], N[(x + t), $MachinePrecision], N[(t * N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{+236}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\
\end{array}
\end{array}
if y < 2.19999999999999978e236Initial program 85.0%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around inf 63.8%
if 2.19999999999999978e236 < y Initial program 93.9%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in a around 0 63.9%
mul-1-neg63.9%
unsub-neg63.9%
associate-/l*63.9%
Simplified63.9%
Taylor expanded in t around inf 57.8%
Final simplification63.4%
(FPCore (x y z t a) :precision binary64 (if (<= a 8.8e+225) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 8.8e+225) {
tmp = x + t;
} 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 <= 8.8d+225) then
tmp = x + t
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 <= 8.8e+225) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 8.8e+225: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 8.8e+225) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 8.8e+225) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 8.8e+225], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 8.8 \cdot 10^{+225}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 8.80000000000000055e225Initial program 85.6%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around inf 61.9%
if 8.80000000000000055e225 < a Initial program 85.5%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around inf 70.5%
Final simplification62.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.25e+168) x t))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.25e+168) {
tmp = x;
} else {
tmp = 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 <= 1.25d+168) then
tmp = x
else
tmp = 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 <= 1.25e+168) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.25e+168: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.25e+168) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.25e+168) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.25e+168], x, t]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.25 \cdot 10^{+168}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if t < 1.24999999999999992e168Initial program 91.5%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in x around inf 55.6%
if 1.24999999999999992e168 < t Initial program 42.5%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in a around 0 20.2%
mul-1-neg20.2%
unsub-neg20.2%
associate-/l*63.0%
Simplified63.0%
Taylor expanded in t around inf 59.5%
Taylor expanded in y around 0 53.6%
Final simplification55.4%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 85.6%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in a around 0 59.1%
mul-1-neg59.1%
unsub-neg59.1%
associate-/l*68.3%
Simplified68.3%
Taylor expanded in t around inf 27.6%
Taylor expanded in y around 0 17.8%
Final simplification17.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (((y - z) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024039
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))
(+ x (/ (* (- y z) t) (- a z))))