I was going to make it a package. I am surprised that Julia does not have this function built in?
julia> @macroexpand @fastmath 1.0f0 / sqrt(2.0f0)
:(Base.FastMath.div_fast(1.0f0, Base.FastMath.sqrt_fast(2.0f0)))
julia> @macroexpand @fastmath inv(sqrt(2.0f0))
:(Base.FastMath.inv_fast(Base.FastMath.sqrt_fast(2.0f0)))
julia> @code_llvm @fastmath 1.0f0 / sqrt(2.0f0)
; @ fastmath.jl:154 within `@fastmath'
define nonnull {}* @"julia_@fastmath_537"({ i64, {}* }* nocapture nonnull readonly align 8 dereferenceable(16) %0, {}* nonnull %1, {}* nonnull align 8 dereferenceable(16) %2) {
top:
%3 = alloca [2 x {}*], align 8
%gcframe2 = alloca [3 x {}*], align 16
%gcframe2.sub = getelementptr inbounds [3 x {}*], [3 x {}*]* %gcframe2, i64 0, i64 0
%.sub = getelementptr inbounds [2 x {}*], [2 x {}*]* %3, i64 0, i64 0
%4 = bitcast [3 x {}*]* %gcframe2 to i8*
call void @llvm.memset.p0i8.i32(i8* nonnull align 16 dereferenceable(24) %4, i8 0, i32 24, i1 false)
%5 = call {}*** inttoptr (i64 4314951312 to {}*** ()*)() #4
; @ fastmath.jl:155 within `@fastmath'
; ┌ @ essentials.jl:480 within `esc'
; │┌ @ boot.jl:253 within `Expr'
%6 = bitcast [3 x {}*]* %gcframe2 to i64*
store i64 4, i64* %6, align 16
%7 = bitcast {}*** %5 to i64*
%8 = load i64, i64* %7, align 8
%9 = getelementptr inbounds [3 x {}*], [3 x {}*]* %gcframe2, i64 0, i64 1
%10 = bitcast {}** %9 to i64*
store i64 %8, i64* %10, align 8
%11 = bitcast {}*** %5 to {}***
store {}** %gcframe2.sub, {}*** %11, align 8
store {}* inttoptr (i64 4310591112 to {}*), {}** %.sub, align 8
%12 = getelementptr inbounds [2 x {}*], [2 x {}*]* %3, i64 0, i64 1
store {}* %2, {}** %12, align 8
%13 = call nonnull {}* @jl_f__expr({}* null, {}** nonnull %.sub, i32 2)
%14 = getelementptr inbounds [3 x {}*], [3 x {}*]* %gcframe2, i64 0, i64 2
store {}* %13, {}** %14, align 16
; └└
store {}* %13, {}** %.sub, align 8
%15 = call nonnull {}* @j1_make_fastmath_539({}* inttoptr (i64 4718928432 to {}*), {}** nonnull %.sub, i32 1)
%16 = load i64, i64* %10, align 8
store i64 %16, i64* %7, align 8
ret {}* %15
}